Commit Graph
19 Commits
Author SHA1 Message Date
Jeppe B f2fc4f6f18 Fix SQL injection risk in booking sync pickup_bool 2026-06-01 23:02:28 +02:00
Jeppe Bundgaard 6814dcd904 Update booking status logic based on wash certificate conditions
- Ensure `status` is set to `completed` if wash certificate PDF exists but status is not already `completed`.
- Update `washCertificateStatus` to `completed` when `status` is `completed` and it is initially `pending`.
- Adjust `wash_certificate_pdf` and `status` logic in the returned booking object.
2025-10-28 12:32:43 +01:00
Jeppe Bundgaard d06f0cedc3 Add new properties and routes for product and booking enhancements
- Added `virtual_cart` property in `bookings_o` and enhanced its structure method.
- Introduced `display_in_booking_form` and `order_priority` properties in `products_o` with updates to object structure, parsing, and routes.
- Enabled handling of product attributes `display_in_booking_form` and `order_priority` in `productsRoute`.
- Added `booked_invoice_id` reset logic in `collected_order_invoices_o`.
- Introduced `machineButtonPressRoute` to log button press incidents and send Slack notifications.
2025-10-28 09:58:29 +01:00
Jepp9350 7a48710fb1 Validate recipients and improve SMS notification handling
Add recipient validation to the SMS gateway API to ensure no empty recipient arrays are processed. Enhance department SMS notification logic by dynamically retrieving phone numbers and logging failures for improved error tracking. Simplify SMS delivery flag logic for better readability.
2025-04-22 15:24:04 +02:00
Jepp9350 8c70e6e3bc Enhance booking handling with service options and transactions
Added support for including customer name, department name, and parsed services in `asArray()` method. Introduced functionality for creating transactions, linking bookings to orders, and properly handling related services. Improved department daily report handling and removed unnecessary fields.
2025-04-16 12:37:57 +02:00
Jepp9350 6efa414251 Refactor SMS and notification logic; add email template.
Updated the SMS sending logic to improve validation and handling of recipients in `gatewayapi.php`. Refactored notification conditions in `bookings_o.php` to ensure proper fallback mechanisms. Additionally, included a new booking notification email template in `email.php`.
2025-04-14 09:58:25 +02:00
Jepp9350 4248a585d9 Add email and notification improvements for bookings
Refactored notification methods to handle Slack, SMS, and email delivery logic more effectively. Introduced `sendBookingNotification` email functionality and a new template for booking notifications. Improved handling of booking data for emails and centralized logic for retrieving booking details.
2025-04-11 12:16:11 +02:00
Jepp9350 b6f2629bed Add invoice splitting, booking notifications, and minor fixes
Implemented functionality to split collected order invoices, ensuring proper validation and handling processor constraints. Added a notification system to inform departments about new bookings via Slack or SMS. Also, included minor enhancements such as a corrected Gateway API URL and improved form handling for wash certificate emails.
2025-04-11 09:39:49 +02:00
Jepp9350 697181f508 Refactor booking creation to improve structure and validation
Replaced raw SQL with a consolidated object-based approach for adding bookings, enhancing maintainability and reducing redundancy. Adjusted form handling to include stricter type casting, additional property checks, and default fallbacks for wash certificate data. These changes improve code readability and error handling while ensuring consistent data processing.
2025-04-10 14:08:09 +02:00
Jepp9350 6e77269418 Add functionality to send wash certificates to customers
Introduced a method to handle the sending of wash certificates via email for bookings with valid certificates. Updated the wash certificate generation process to trigger this new functionality automatically.
2025-04-10 13:08:39 +02:00
Jepp9350 c8df3230d1 Remove unused form and enhance wash certificate handling
The `book_interior_wash_f` form was removed due to redundancy. Added functionality to handle wash certificate generation, including safety seal and operator data, and added a new form `complete_booking_f` to finalize bookings without certificates. Adjustments were made to several related components to ensure seamless integration.
2025-04-10 12:57:29 +02:00
Jepp9350 dce9f1b616 Refactor bookings handling and update wash certificate logic
Reverted table name from 'bookings_new' to 'bookings' and removed unused sync data structure. Updated routes to use 'wash_certificate_store' instead of 'pdf_store' for wash certificate management. Added 'taulov' as a new department legacy name entry.
2025-03-27 13:11:17 +01:00
Jepp9350 8aee687106 Add new booking handling features and improve validations
Introduced support for a `data` property in bookings, extended form handling with additional validation and input fields, and added functionality for retrieving booking counts by date and status. Improved safety seal labeling and enhanced PDF generation comments.
2025-03-27 10:53:54 +01:00
Jepp9350 54940e7cd7 Add wash certificate generation feature and refine booking logic
Introduces a form for generating wash certificates associated with bookings, along with validations and access restrictions. Refactors booking management to integrate a new `bookings_new_o` class, enhancing structure and adding functionalities like caching and detailed error handling.
2025-03-25 18:40:42 +01:00
Jepp9350 9536b67998 Refactor unfulfilled bookings notification logic
Introduce a function to aggregate unfulfilled bookings by department. Replace individual Slack notifications with a single summary per department, improving efficiency and reducing redundant calls.
2025-02-19 17:54:53 +01:00
Jepp9350 7525a89154 Refactor database operations and enhance routes for consistency
Refactored database methods to improve code readability, reusability, and error handling. Introduced input validation helper functions and parsing capabilities for objects with optional callbacks. Added new routes for handling categories and improved product-related functionality to align with the new architecture.
2025-02-12 16:39:52 +01:00
Jepp9350 c240bbd94f Refactor database object trait and improve data handling
Added `delete`, `restore`, and other utility methods to enhance CRUD operations, including support for soft deletes. Introduced `objectChanged` hooks across objects for better cache or event handling, ensuring scalability and maintainability. Refactored and standardized object property handling while restructuring related methods.
2025-02-12 09:23:35 +01:00
Jepp9350 1e8c60e33a Refactor booking status handling and enhance file checks.
Updated booking logic to include completed bookings in cancellation handling. Added `isFileInStore` to improve file existence checks in the wash certificate store. Adjusted file server logic to use the new method for enhanced clarity and maintenance.
2025-02-03 09:34:09 +01:00
Jepp9350 707df910b0 Refactor: migrate files 2025-01-29 14:27:44 +01:00