Commit Graph
253 Commits
Author SHA1 Message Date
Jeppe Bundgaard 64faea9324 Add password reset endpoint and refactor booking count logic
- Introduce `POST /auth/password-reset/request` endpoint in test and `authRoute.php`.
- Refactor bookings route to use a new method `getDailyUnfulfilledBookingsCountForDepartment`
2026-01-22 14:38:54 +01:00
Jeppe Bundgaard 29c53c3b70 Improve Slack message formatting and update date handling in department statistics
- Apply Markdown formatting to Slack messages for better readability.
- Adjust date range to end on the previous day in `workerRoute.php`.
- Refactor department loop output for consistent indentation and styling.
2026-01-22 12:53:38 +01:00
Jeppe Bundgaard e0e479a15d Introduce method-level caching for department reports to enhance performance
- Wrap report calculation logic in `methodCacheWithParameters` for 2-minute caching.
- Standardize reusable caching logic in `db_object_t` trait.
- Refactor query-based methods to integrate caching and improve maintainability.
2026-01-22 12:18:39 +01:00
Jeppe Bundgaard d58fa69560 Refactor addon sales calculation logic and improve date handling in reports
- Standardize date formatting to cover full days in queries (`00:00:00` to `23:59:59`).
- Replace direct SQL queries with reusable department methods for calculating total addons and max addons.
- Update Slack notifications to include percentage breakdown with sold/total for each department.
- Remove redundant code and improve error handling for department data retrieval.
2026-01-22 10:19:06 +01:00
Jeppe Bundgaard 16703f5938 Add Slack department statistics notification method and improve percentage calculation
- Introduce `sendSlackInternalStatisticNotification` to handle Slack notifications for department performance.
- Refactor `getThePercentageOfAddonsSoldOutOfMax` to enable reference-based updates for addon data.
- Improve date handling and filtering logic to skip null values for inclusive range filters.
2026-01-22 08:44:35 +01:00
Jeppe Bundgaard 1d3e23b370 Simplify Slack message logic by removing department name from default notification. 2026-01-21 14:54:22 +01:00
Jeppe Bundgaard a04acd84b2 Refactor Slack notification logic and clean up response format in example route. 2026-01-21 14:51:20 +01:00
Jeppe Bundgaard d9b9958242 Fix calculation logic for max addons count by replacing division with multiplication in SQL query 2026-01-21 14:46:55 +01:00
Jeppe Bundgaard 56d0ee03d3 Update product addon sales calculation logic and refine Slack notification handling for departments
- Replace `COUNT` with `SUM` for accurate addon quantity tracking in sales queries.
- Implement support for filtering applicable products when calculating max addons.
- Add logic to handle custom Slack webhooks for department notifications.
- Refactor percentage calculation methods and remove redundant return statements.
2026-01-21 14:40:55 +01:00
Jeppe Bundgaard 9b41f80ea5 Add methods to retrieve and analyze product sales data, send department statistics to Slack, and implement scheduled messaging logic 2026-01-21 13:42:19 +01:00
Jeppe Bundgaard d4ba8b7564 Add getLaneProducts method to department_selfserve_tasks_o and implement lane product retrieval in related objects and routes; enhance object validation with requireSelected method 2026-01-20 13:19:20 +01:00
Jeppe Bundgaard 67e27f67a4 Ensure removal of existing entries for identical department, lane, reg, and question before adding new objects in department_selfserve_vehicle_conditions_o 2026-01-19 14:57:15 +01:00
Jeppe Bundgaard da9ee98fb5 Add password reset request endpoint to authentication routes; update OpenAPI spec and improve user email handling in users_o 2026-01-19 11:17:35 +01:00
Jeppe Bundgaard eb6cc72bf5 Add customer_password_reset_keys_o class with token generation, validation, and password reset functionality. 2026-01-19 10:41:42 +01:00
Jeppe Bundgaard 6cc5344fc2 Refactor department-level permission checks and enhance handling of empty department filters across routes and related object methods. 2026-01-15 11:28:44 +01:00
Jeppe Bundgaard 92c5a03791 Add departmentSelfserveVehicleConditionsRoute with CRUD operations and department-level access control; update department_selfserve_vehicle_conditions_o to support customer_id property. 2026-01-12 11:20:51 +01:00
Jeppe Bundgaard d8f102b764 Add department_selfserve_vehicle_conditions_o class and standardize_registration method to manage vehicle conditions and standardize registration input 2026-01-12 11:15:23 +01:00
Jeppe Bundgaard 6689ad991a Expand object_type documentation in department_selfserve_condition_rules_o to include condition_rule. 2026-01-09 15:15:02 +01:00
Jeppe Bundgaard 97d2786ff1 Replace question_condition with condition_id across department_selfserve_questions logic, routes, OpenAPI spec, and related methods for improved consistency and clarity. 2026-01-09 13:53:03 +01:00
Jeppe Bundgaard d576a4741b Replace question with condition_id across department_selfserve_tasks logic, routes, OpenAPI spec, and associated methods for improved consistency and clarity. 2026-01-09 13:47:10 +01:00
Jeppe Bundgaard 69c2acf66f Add id property to department_selfserve_condition_rules_o array representation 2026-01-09 13:21:45 +01:00
Jeppe Bundgaard f7ff5d6713 Add condition_id property to department_selfserve_conditions_o and update related methods, routes, and logic 2026-01-09 12:56:11 +01:00
Jeppe Bundgaard b4eda9ed9c Add department_selfserve_conditions_o and department_selfserve_condition_rules_o for managing self-serve conditions and rules 2026-01-09 12:34:14 +01:00
Jeppe Bundgaard 0de2fd7331 Replace image property with question_condition in department_selfserve_questions_o and refactor associated methods and fields. 2026-01-09 11:17:57 +01:00
Jeppe Bundgaard d00337c050 Add delete method to department_selfserve_questions_o for removing question references from tasks 2026-01-08 14:25:38 +01:00
Jeppe Bundgaard a127a6f846 Add department_selfserve_tasks_o object for managing department self-serve tasks 2026-01-08 13:52:49 +01:00
Jeppe Bundgaard c6c0bb970a Add department_selfserve_questions_o object and related route for managing department self-serve questions 2026-01-08 11:06:49 +01:00
Jeppe Bundgaard 0eddf69ae4 Replace getCustomerByIdOrCustomerNumber with getUserByCustomerNumber across services and remove deprecated method. 2026-01-06 15:50:59 +01:00
Jeppe Bundgaard 49589de98e Update getUserByCustomerNumber references to getCustomerByIdOrCustomerNumber and enhance null-checking in requireSelected. 2026-01-06 15:40:05 +01:00
Jeppe Bundgaard 19c13977ca Ensure administration fee exemption for users with the relevant attribute and enhance null-checking in requireSelected. 2026-01-06 15:02:46 +01:00
Jeppe Bundgaard 71261c3933 Add administration fee handling to invoice collections, ensuring fees are applied monthly or per order if unpaid. 2026-01-06 14:52:25 +01:00
Jeppe Bundgaard 3bca46c457 Enhance decodeData method to better handle double-escaped JSON by adding additional decoding attempts. 2026-01-06 11:51:48 +01:00
Jeppe Bundgaard d244294dd9 Improve decodeData method to handle HTML-encoded JSON and ensure it returns an array. 2026-01-06 11:48:51 +01:00
Jeppe Bundgaard b2c6273e72 Add lane status to asArray and implement detailed department lane retrieval 2026-01-06 10:56:29 +01:00
Jeppe Bundgaard bcca9dd319 Add getOrderBooking method to fetch linked booking object for orders 2026-01-02 11:18:06 +01:00
Jeppe Bundgaard 5a71889b26 Add support for optional bayId in license plate scans
- Updated `plateScansRoute` to handle an optional `bay_id` parameter in plate scan requests.
- Extended `plate_scans_o` object to include `bay_id` property and related database operations.
- Enhanced `add` method to validate and process `bayId` if provided.
2025-12-15 10:14:00 +01:00
Jeppe Bundgaard f8af8cae46 Add lane management extensions to department functionality
- 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.
2025-12-09 14:38:59 +01:00
Jeppe Bundgaard 3cbce2a68f Add detailed customer booking notifications with message formatting
- 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.
2025-12-09 10:58:34 +01:00
Jeppe Bundgaard 68e93fdd9d Add relay_machine_id property to department_lanes_o object and extend related functionality
- 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.
2025-12-09 10:26:32 +01:00
Jeppe Bundgaard d3d3657dfd Generate and attach wash certificate to orders
- 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.
2025-12-03 08:45:13 +01:00
Jeppe Bundgaard b45e270fed Skip transactions not included in invoicing
- Updated `customer_vehicles_o` to exclude transactions not marked for invoicing during processing.
2025-12-01 13:20:07 +01:00
Jeppe Bundgaard d3a8d0d83d Add enabled property to accounts_o
- Introduced `$enabled` property to `accounts_o` for managing account status.
- Updated property initialization and `asArray` method to include `enabled`.
2025-11-28 10:48:59 +01:00
Jeppe Bundgaard ce51feb9ab Add caching logic to accounts_o and enhance asArray method
- Implemented cache invalidation in `objectChanged` method.
- Enhanced `asArray` method with caching support and type casting.
- Added cache expiration and retrieval logic to improve performance.
2025-11-28 10:44:03 +01:00
Jeppe Bundgaard 1cdaa230d8 Add accounts_o object for account management
- 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`.
2025-11-28 10:32:52 +01:00
Jeppe Bundgaard 8302b05028 Add cashier name retrieval and caching logic to orders processing
- 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.
2025-11-27 15:08:07 +01:00
Jeppe Bundgaard 542596b5a0 Refactor customer email retrieval logic in booking and email handling
- 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.
2025-11-27 10:50:49 +01:00
Jeppe Bundgaard 2ec936225c Refactor booking notifications and product restriction 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.
2025-11-27 10:25:53 +01:00
Jeppe Bundgaard ecd44a455a - Add Redis mget method and cache management improvements
- 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`
2025-11-26 10:01:24 +01:00
Jeppe Bundgaard 3dba2dedac Add isIncludedInInvoicing method and implement invoicing exclusions
- 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.
2025-11-25 14:39:49 +01:00
Jeppe Bundgaard 537582e44d Add isExcludedFromInvoicing method to departments_o
- Introduced `isExcludedFromInvoicing` to check if a department is excluded from invoicing.
- Ensured selected department validation before retrieving exclusion status.
2025-11-25 13:04:57 +01:00