Commit Graph
16 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 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 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 e45ab68959 Add admin endpoint for fetching customer names and enhance order booking object with parsed product names
- 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`.
2025-11-12 13:21:22 +01:00
Jeppe Bundgaard 5193038bea Send wash certificate email to customers during order bookings
- 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.
2025-11-11 15:32:10 +01:00
Jeppe Bundgaard 8b2aa76070 Add methods to handle user notification preferences and update booking notification logic
- Introduced `wantsSmsNotifications`, `wantsEmailNotifications`, and `getWashCertificateEmail` methods in `users_o`.
- Updated `order_bookings_o` to incorporate user notification preferences for sending SMS and email confirmations.
2025-11-11 14:48:32 +01:00
Jeppe Bundgaard ccb049519c Add support for customer booking notifications and phone number updates
- 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.
2025-11-11 13:24:32 +01:00
Jeppe Bundgaard 7f838c0961 Refactor conditional logic in db_object_t and implement booking notifications in order_bookings_o
- 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.
2025-11-11 11:49:00 +01:00
Jeppe Bundgaard 72c028c0fd Prevent editing of bookings with associated transactions
- Added transaction check in `orderBookingRoute` to block edits on bookings tied to transactions.
- Introduced `hasTransaction` method in `order_bookings_o` to verify transaction association.
2025-11-11 08:04:13 +01:00
Jeppe Bundgaard a519478788 Implement wash certificate handling for bookings and order processing
- 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.
2025-11-10 15:45:24 +01:00
Jeppe Bundgaard ed7ace3a1b Update completeBooking method TODO to include price re-calculation for customer-specific adjustments 2025-11-10 12:13:38 +01:00
Jeppe Bundgaard ad55e97b54 Refactor completeBooking method call and add method skeleton in order_bookings_o
- 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.
2025-11-10 12:09:22 +01:00
Jeppe Bundgaard b76c4deaa9 Add notification functionality for new order bookings
- 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.
2025-11-10 11:46:22 +01:00
Jeppe Bundgaard c0b6ed6972 Add order_id handling in orderBookingRoute
- Added `order_id` extraction logic with validation in `getTargetOrderId` method.
- Included `order_id` in the data update process for order bookings.
- Updated `order_bookings_o` class to support `order_id` property.
2025-11-10 10:31:57 +01:00
Jeppe Bundgaard b564d8d500 Add order bookings functionality with permissions and access control
- Introduced `order_bookings_o` class for interacting with the `order_bookings` database table.
- Added `hasDepartmentAccess` method to handle department-level permissions.
- Implemented new routes for creating and retrieving order bookings, including pagination support.
- Enhanced access control to differentiate between own and departmental bookings based on permissions.
- Updated input validation and improved error handling for order bookings.
2025-11-05 13:57:12 +01:00