- Enforce validation to ensure department distribution matches total subscription price.
- Skip transactions not included in invoicing for improved accuracy.
- Uncomment permission checks in specific routes.
- Introduced `$enabled` property to `accounts_o` for managing account status.
- Updated property initialization and `asArray` method to include `enabled`.
- Implemented cache invalidation in `objectChanged` method.
- Enhanced `asArray` method with caching support and type casting.
- Added cache expiration and retrieval logic to improve performance.
- Implemented `accounts_o` class with account properties (`phone`, `country_code`, `name`, etc.).
- Added `add` method for creating new account entries with input sanitization and default values.
- Introduced `asArray` method for converting object data into array format.
- Included property initialization in `getObjectProperties` for `accounts_o` object.
- Set up table structure and placeholders for caching logic in `objectChanged`.
- Introduced `getCashierName` method in `users_o` for cashier name retrieval.
- Added caching for cashier names with dedicated expiration settings.
- Updated `ordersRoute` to include cashier names in order details.
- Added `$cashierNameCacheExpiration` property in `db_object_t` for centralized cache control.
- Replace direct wash certificate email retrieval with `getWashCertificateEmail` method.
- Fallback to default email if no certificate-specific email exists.
- Adjust email assignment in booking notifications to use consistent logic.
- Enable department notification for new bookings.
- Enhance Slack notification details for bookings, including customer, vehicle, and items.
- Replace `isGuest` with `isProductDetailsRestricted` for better clarity in `productsRoute`.
- Adjust product parsing to handle restricted product details consistently.
- Implement guest-specific product redactions (e.g., hide names, reset prices).
- Refactor `parseProduct` to include guest context for dynamic response handling.
- Add authentication checks and guest user handling for accurate permission validation.
- Update logging to include guest or user context in actions.
- Adjust product and addon parsing for consistent guest visibility.
- Update cache expiration times for `economicCustomerName` and `isBooked` objects
- Introduce `getCachedForMultipleObjects` for batch cache retrieval
- Optimize `isBooked` with optional caching and update to store results
- Implement `getCustomerNames` in `users_o` with caching for bulk name retrieval
- Refactor customer transaction handling in `InvoicingPeriodRoute` for efficiency
- Filter orders excluded from invoicing in `collected_order_invoices_o`
- Introduced `isIncludedInInvoicing` in `orders_o` to check department-based invoicing exclusions.
- Updated routes and methods to skip orders excluded from invoicing.
- Refined transaction and order handling to respect invoicing settings, ensuring correct filtering.
- Introduced `isExcludedFromInvoicing` to check if a department is excluded from invoicing.
- Ensured selected department validation before retrieving exclusion status.
- Updated `db_object_t` to treat both `null` and string `'null'` as null values for filtering.
- Added `deleted_at IS NULL` condition in `vehiclesRoute` booking-related queries to exclude soft-deleted entries.
- Introduced optional `department` parameter in `vehiclesRoute` for filtering booked registrations.
- Validated `department` input to ensure existence and access rights.
- Updated `getBookedRegs` to support dynamic filtering with department-specific criteria.
- Updated booking-related queries to use `order_bookings_o` for improved consistency and clarity.
- Replaced `regNrTraekker`/`regNrTrailer` with `reg_1`/`reg_2` in queries and results.
- Added `NULL` condition handling in `db_object_t` to support filtering by null field values.
- Enhanced booking data extraction with renamed fields (`reference_number` → `reference`, `notes` → `note`).
- Introduced `GET /guest/departments` in `guestRoute` to fetch departments with pagination.
- Limited response to include only `id` and `name` fields for streamlined output.
- Introduced parameter checks to ensure validation only occurs if fields are set and non-empty.
- Added default values for missing `email` and `phone` fields to improve robustness.
- Adjusted logic to use `companyPhone` and default email (`jb@truckwash.dk`) when applicable.
- Moved redundant order update logic to a centralized `updateOrder` method for better code reuse.
- Simplified route definitions in `ordersRoute` by delegating updates to the new `updateOrder` method.
- Added `NoReturn` attribute for improved type hinting and error handling.
- Corrected typecasting for product prices to ensure consistent integer values.
- Enhanced product parsing logic for better modularity and data handling in `productsRoute`.
- Refactored `getAllProductInDepartmentCategories` in `departments_o` using `array_reduce` for cleaner and more efficient category loop.
- Enhanced `productsRoute` to filter department-specific products using IDs for stricter matching.
- Added methods in `department_categories_o`, `departments_o`, and `categories_o` to retrieve products associated with department categories.
- Updated `productsRoute` and `superuserDepartmentRoute` to fetch department-specific products.
- Fixed typecasting in product price assignments for improved data consistency.
- Introduced `/guest/cvr/search` endpoint in `guestRoute` for company search using CVR.
- Added `/auth/register/cvr` endpoint in `authRoute` to handle CVR-based registration with validation.
- Enhanced `virkdata` with `searchCompanies` and improved response handling for search requests.
- Updated E-conomic integration to check for existing CVR registrations and create new customers where needed.
- Adjusted `productsRoute` to include products from categories "1" and "3" when category "6" is requested.
- Merged additional products to ensure comprehensive category listings.
- Introduced `POST /guest/validation/customer-number` in `guestRoute` to validate customer number existence.
- Implemented checks for required parameter format and range.
- Integrated `users_o` to verify if the customer number exists.
- Introduced `GET /admin/customer/name` endpoint in `userRoute` to retrieve customer names by user ID.
- Enhanced `order_bookings_o` with product name parsing for booking items.
- Added `customer_name` retrieval to `asArray` method in `order_bookings_o`.
- Implemented private `parseProductNames` method for item details parsing in `order_bookings_o`.
- Added `sendWashCertificateToCustomer` method in `order_bookings_o` to handle email sending for wash certificates.
- Implemented `sendWashCertificateEmailToCustomer` in `email` to generate and attach wash certificate PDFs.
- Updated attachment permission logic in `ordersRoute` and `db_object_t`.
- Changed `object_attachments_o` property types and handling for improved attachment processing.
- Added conditional logic to prioritize `wash_certificate_email` if provided for customer notifications.
- Refactored email setup to use the selected email for wash certificate-related bookings.
- Introduced `wantsSmsNotifications`, `wantsEmailNotifications`, and `getWashCertificateEmail` methods in `users_o`.
- Updated `order_bookings_o` to incorporate user notification preferences for sending SMS and email confirmations.
- Introduced new endpoint to update user notification preferences (email, SMS, wash certificate notifications).
- Enhanced `users_o` with new properties: `sms_notifications_enabled`, `email_notifications_enabled`, and `wash_certificate_email`.
- Added methods to set notification preferences in `users_o`.
- Introduced phone number update functionality in `userSecurityRoute`.
- Enhanced `order_bookings_o` to send booking confirmations to customers via SMS and email.
- Added `sendOrderBookingConfirmationEmail` method in `email` for HTML-based email notifications.
- Updated `notifyNewBooking` to include customer confirmation logic with SMS and email.
- Adjusted `users_o` to make phone and email properties public and added `setPhoneNumber` method.
- Optimized notification logic in `order_bookings_o` with department and customer-specific notifications.
- Optimized conditional checks and improved value handling (null, boolean, numeric, strings) in `db_object_t`.
- Added `notifyNewBooking` method in `order_bookings_o` to handle department notifications for new bookings.
- Updated Slack message template for booking notifications.
- Introduced separate permissions for listing all order attachments and own order attachments.
- Added conditional logic to verify ownership of orders for `list_own_order_attachments` permission.
- Improved error responses for unauthorized access to order attachments.
- Added boolean to integer conversion in `db_object_t` during database operations.
- Improved handling of null values, numeric types, and sanitized inputs in `db_object_t`.
- Enhanced safety seal parameter validation in `orderBookingRoute` with support for nullable integers.
- Updated `getTargetItems` to retrieve product names for each item in the order.
- Added transaction check in `orderBookingRoute` to block edits on bookings tied to transactions.
- Introduced `hasTransaction` method in `order_bookings_o` to verify transaction association.
- Updated `getUserId` logic in `userRoute` to allow users to fetch their own user ID without requiring additional permissions.
- Corrected `customer_number` type in `orderBookingRoute` to always return an array.
- Added exception handling with logging when fetching customer by ID fails.
- Improved safety checks to ensure customer existence before returning the object.
- Return `null` in case of failure to prevent unhandled errors.
- Added functionality to create and attach wash certificates during booking completion.
- Enhanced `completeBooking` to generate and associate wash certificates with orders based on booking items.
- Updated safety seal parameter handling in relevant methods.
- Integrated wash certificate PDF generation with customer branding and order attachment logic.
- Improved file retrieval logic in the `file_server` to handle missing certificates via alternative store lookup.
- Updated `completeBooking` method call to directly use `$user->id` without `value()` extraction.
- Added `completeBooking` method skeleton in `order_bookings_o` with placeholders for future implementation.
- Implemented `onAfterNewBooking` and `notifyNewBooking` methods to handle post-booking notifications.
- Added Slack and SMS notifications for departments upon creating new bookings.
- Enhanced error handling and logging for failed encoding and notification delivery.
- Updated `db_object_t` to JSON encode objects and arrays before database operations.
- Introduced `/order-bookings` DELETE route to enable deletion of order bookings.
- Implemented robust permission checks for deleting own and departmental bookings.
- Included detailed access control and error handling for unauthorized operations.
- Ensured proper success and error response handling.