- Added validation to ensure the user owns the invoice and it has been booked before generating the PDF.
- Updated logic to retrieve and store booked invoice PDFs using the correct `booked_invoice_id`.
- Improved error handling for unauthorized access and unbooked invoices.
- Introduced `getLanes` method in `departments_o` to retrieve associated lanes.
- Extended `department_lanes_o` with `getLaneStatus` and `getDepartmentLanes` methods for lane data handling.
- Updated guest route to support `include_lanes` parameter, enabling retrieval of lanes and their statuses for departments.
- Enhanced response structure with lane information when requested.
- Enhanced booking notifications to include comprehensive customer and booking details.
- Implemented message formatting for clarity: customer info, date, vehicle(s), items, references, PO, and pickup status.
- Improved notification structure by integrating branding name into messages.
- Introduced `relay_machine_id` to `department_lanes_o` for managing Shelly relay associated with machines.
- Updated `add` method and database interactions to support the new property.
- Included `relay_machine_id` in `asArray` and field initialization logic.
- Enhanced `departmentLanesRoute` to handle `relay_machine_id` via API for creation and updates.
- Introduced `selfserve_lane_command_arguments` class for managing lane command parameters (e.g., customer number, license plate).
- Added traits for handling lane timer, invoice generation, license plate, and customer number management.
- Implemented minute-based billing logic with `selfserve_minute_product_c` configuration.
- Enhanced `selfserve_lane` with new behaviors: command arguments, invoicing, and time handling.
- Added `/modules/self-serve/lane/command` route for executing lane commands (START, STOP, RESET).
- Updated `/modules/self-serve/lane/status` route to include additional lane details (wash start, elapsed time, license plate, etc.).
- Improved Shelly device relay control for port management.
- Added `selfserve_lane` class to handle self-serve lane operations.
- Implemented commands (START, STOP, RESET) and states (IDLE, IN_WASH, FAULT, etc.) for lane lifecycle.
- Introduced traits for managing lane status, mode, state, caching, and port control.
- Added enums for cohesive type definitions (`selfserve_lane_command`, `selfserve_lane_status`, `selfserve_lane_state`, etc.).
- Configured `/modules/self-serve/lane/status` route to expose lane state and status via API.
- Linked self-serve configuration via `selfserve_c` and `selfserve_enabled_c` for module toggling.
- Integrated lane caching logic with Redis for performance improvements.
- Updated `index.php` to include the self-serve module.
- Added `generateWashCertificate` method to `orders_o` for wash certificate PDF generation and attachment.
- Introduced `OTHER_TYPE_WASH_CERTIFICATE` constant in `attachment_content` for new attachment type.
- Added `/order/wash-certificate` route to provide wash certificate generation functionality via API.
- Introduced `/worker/version` route to retrieve current worker target version.
- Added `/worker/update-version` route to update worker target version with permission and parameter validation.
- 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.