Commit Graph
121 Commits
Author SHA1 Message Date
Jeppe Bundgaard 5a59562e35 Add Bird API integration with voice call and flash call support
- Implement Bird API client (`bird.php`) for handling HTTP requests to Bird services.
- Add routes for voice and flash call management (`birdVoiceFlashCallsRoute.php`, `birdNumbersRoute.php`).
- Introduce test cases for voice calls, flash calls, and numbers (`VoiceCallsApiTest.php`, `NumbersAndFlashCallsApiTest.php`).
- Include configuration management classes and APIs for enabling the Bird module and managing API keys (`bird_c.php`).
- Provide OpenAPI specifications for flash call endpoints (`bird-flash-calls.md`).
2026-02-19 12:19:36 +01:00
Jeppe Bundgaard efaed8c6cc Refactor new customer email template and attachments handling
- Update welcome email template to conditionally include corporate ID.
- Remove unused base64 signature utility and clean up the email class.
- Comment out attachments array for potential future updates.
2026-02-17 12:07:03 +01:00
Jeppe Bundgaard b7648ccc2c Update new customer email template with dynamic company data and revised signature assets
- Dynamically insert company name and corporate ID in welcome message.
- Replace signature image URLs with updated assets and ensure proper loading.
- Add utility for retrieving base64-encoded signatures to enhance flexibility.
2026-02-17 12:01:10 +01:00
Jeppe Bundgaard 3e76bdccc2 Add HTML email template for new customer welcome email and integrate into email class 2026-02-17 11:43:14 +01:00
Jeppe Bundgaard 1791a62992 Remove port from file download URLs in attachment_store.php and upload_store.php 2026-02-16 15:10:38 +01:00
Jeppe Bundgaard 4248de1d7d Add password reset link generation and welcome email functionality
- Introduce `generatePasswordResetLink` method in `users_o` for creating secure password reset links.
- Add `sendWelcomeEmailToCustomer` method to `email` class with support for attachments.
- Update `authRoute.php` to send welcome emails when creating new customers.
- Extend `sendEmail` to handle optional attachments and references.
- Disable PHP entrypoint in Dockerfile for improved flexibility.
2026-02-16 14:55:01 +01:00
Jeppe Bundgaard 19139b08cb Extend authentication to handle subuser tokens with customer number resolution 2026-02-12 16:17:32 +01:00
Jeppe Bundgaard 497ef1496b Add subuser permission evaluation system and extend subuser-related route handling
- Introduce `hasPermission` method in `subusers_o` for permission checks tied to customer context.
- Update `/subusers/me` route to return subuser grants with normalized permissions and metadata.
- Add `get_subuser_customer_number_target` in `authentication` to resolve customer context from request headers.
- Refactor route-level permission checks to handle subuser grants dynamically.
- Introduce CLI test scripts for subuser grants and permission node mappings.
- Add test coverage for subuser grants and permission nodes in new test classes.
2026-02-12 15:29:43 +01:00
Jeppe Bundgaard d26b94de3b Integrate subuser permission node system and refactor route-level permissions
- Add `permission_node` DTO to link classic permissions with subuser-specific nodes.
- Extend `authentication` to support subuser resolution via tokens.
- Introduce route traits for permission evaluation with subuser context.
- Update `requirePermission` and `hasPermission` to handle subuser grants dynamically.
- Implement fallback mechanisms for customer number context in subuser permissions.
2026-02-12 13:54:28 +01:00
Jeppe Bundgaard 62a7f8d259 Handle bool and json types in object_property and normalize permissions in subuser_grants_o
- Add support for `bool` and `json` types when updating database values in `object_property`.
- Normalize `permissions` handling in `subuser_grants_o` to ensure consistent API output for array data.
2026-02-12 13:19:57 +01:00
Jeppe Bundgaard 5aa575268f Add booked invoice helper and retrieval methods
- Introduce `economic_invoice_booked` helper for normalizing booked invoice data.
- Add `getFromId` method to fetch booked invoice details by ID.
- Extend `economic` class with `getInvoiceBookedFromExternalId` for external ID-based retrieval.
- Update imports and economic helper class registrations to include booked invoice functionality.
2026-02-03 12:19:42 +01:00
Jeppe Bundgaard 4778486dac Add SSL mode support for database backups and enhance directory creation checks
- Introduce SSL mode configuration (`ssl_mode`) for `mysqldump` to support secure database backups.
- Update database backup logic to handle SSL options (`DISABLED`, `PREFERRED`, `REQUIRED`, `VERIFY_CA`, `VERIFY_IDENTITY`).
- Improve directory creation checks in backup logic with additional error handling.
- Update `config.example.php` to include `ssl_mode` configuration.
2026-02-02 14:24:28 +01:00
Jeppe Bundgaard ad0277ff17 Enhance input validation, unicode handling, and sanitization across department goal criteria
- Add `validateAndSanitize` method to `goals_criteria` for input validation and defaulting incorrect values.
- Ensure JSON encoding in `response` and database interactions respects Unicode (`JSON_UNESCAPED_UNICODE`).
- Sanitize and validate input for `department_goals_o::add` and criteria usage.
- Fix header character encoding in response (`Content-Type: application/json; charset=utf-8`).
- Update criteria `label` sanitization with trimming, length limits, and safe character handling.
2026-01-27 08:20:33 +01:00
Jeppe Bundgaard 88d3e20de6 Expire department webhook in Redis and refactor Slack notification logic
- Add 5-minute expiration for cached department webhooks in `redis.php`.
- Cast department ID to integer in `departments_o.php`.
- Refactor Slack notification logic to use `send_webhook_message` for custom department webhooks.
- Update `send_webhook_message` visibility from protected to public in `slack.php`.
2026-01-26 13:09:21 +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 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 60244dd106 Ensure error handling for invalid json_decode output by adding array validation checks across routes, traits, and response methods. Replace echo statements with standardized response error handling in module_config_t. 2026-01-13 11:56:17 +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 c87f96ebcf Add update method as alias for set in object_property class 2026-01-09 13:22:59 +01:00
Jeppe Bundgaard 1b914b546e Add minute-based billing and lane management extensions to self-serve module
- 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.
2025-12-08 23:05:35 +01:00
Jeppe Bundgaard cc6639e61b Introduce self-serve module with lane management functionality
- 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.
2025-12-08 15:34:40 +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 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 5b01644c0a Add CVR handling to guest and auth routes with virkdata integration
- 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.
2025-11-17 13:20:12 +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 65bf42d3e3 Update email recipient logic for wash certificate bookings
- 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.
2025-11-11 15:03:42 +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 f206e7f4fb Add JSON type support in object property handling
- Added `json` to the list of valid types for object properties.
- Implemented JSON decoding for column values when the type is `json`.
2025-11-05 13:16:31 +01:00
Jeppe Bundgaard af6b89ff54 Enhance authentication logic for customers with default passwords
- Added a check to ensure customers with group ID other than 0 cannot use default passwords.
- Implemented logic to auto-set passwords to the last 4 digits of the customer number if no password is set.
- Updated method documentation to include an `@throws Exception` annotation.
2025-10-28 11:06:18 +01:00
Jeppe Bundgaard b78d9e0e63 Add email blacklist check to prevent sending to specific addresses
- Added a static blacklist in `sendEmailMailerSend` to skip sending emails to blacklisted addresses.
- Implemented a return condition if the recipient email matches the blacklist.
2025-10-21 08:39:36 +02:00
Jeppe Bundgaard c775ca7b19 Expand Shelly module capabilities with POST requests and device switch management
- Updated `shelly` class to support POST request handling (`sendPostRequest`) and server URL validation.
- Adjusted `shelly_device_state` to handle object-based `status` and `settings`, adding a `populate` method for data initialization.
- Added `shelly_device_switch` helper to manage switching operations via Shelly API.
- Removed unused `api_url` property in `shelly` class.
- Modified `shelly_i` interface with definitions for `requireValidServerUrl` and `sendPostRequest`.
2025-10-15 13:08:27 +02:00
Jeppe Bundgaard e82b4950b7 Integrate Shelly module with new routes, classes, helpers, and configurations
- Added `shelly` class to manage API operations, handle requests, and validate configurations.
- Introduced `shelly_i` interface and supporting helpers: `shelly_device_state`, `shelly_request_body_get_states`, and `shelly_response_body_get_states`.
- Created new routes for fetching and updating Shelly configurations (`/shelly/config`).
- Added Shelly module configurations: `enabled`, `secret_key`, and `server_url`.
- Implemented `shelly_c` for module setup and configuration handling.
- Integrated Shelly initialization in `index.php`.
2025-10-15 10:54:01 +02:00
Jeppe Bundgaard ce9913429f Integrate caching for CVR lookup, add economic customer creation endpoint, and enhance license plate recognition validation
- Implemented Redis caching for CVR lookups to improve performance and reduce API calls.
- Introduced economic customer creation functionality with new `createCustomer` method and corresponding route.
- Enhanced license plate recognition validation to handle plates shorter than 3 characters.
2025-10-13 13:32:11 +02:00
Jeppe Bundgaard ca29ded6be Integrate Virkdata module with new routes, helpers, and configurations
- Added `virkdata` class to handle API operations for company information retrieval and config validation.
- Introduced `virkdata_i` interface and supporting helpers: `virkdata_request_parameters`, `virkdata_response`, and enums for formats, countries, and error codes.
- Implemented new routes: `/worker/debug`, `/worker/licenseplates`, `/cvr/lookup`, and `/economic/doesCustomerExist`.
- Added module `Virkdata` route for searching company data and fetching/updating configurations (`moduleVirkDataRoute`).
- Created `virkdata` module configurations: `enabled`, `secret_key`, and `monthly_limit`.
- Integrated virkdata initialization in `index.php`.
2025-10-12 12:50:57 +02:00
Jeppe Bundgaard 11ac183fb1 Add support for tracking last submitted form and booking object
- Introduced `last_submitted_form` and `form_submission` properties in the `form` class to retain details of the most recently submitted form.
- Updated form submission logic to assign `booking_object` where applicable.
- Enhanced response in `formRoute.php` to include booking data when available.
2025-09-23 16:04:35 +02:00
Jeppe Bundgaard 538aa24dc7 Add order attachments module
- Implemented CRUD operations for order attachments, including adding, listing, downloading, and deleting.
- Updated `db_object_t` and `attachments` to enhance object-attachment interactions with new methods for formatting, creating, and managing attachments.
- Added new routes (`/orders/attachments` and `/attachments/upload`) for attachment-related functionality.
- Adjusted `file_server.php` to handle temp file downloads and attachment storage.
- Improved typing and error handling across attachment helper methods and classes.
2025-09-22 12:31:53 +02:00
Jeppe Bundgaard 33a26cffc5 Implement attachments module with CRUD operations and integration points
- Added `attachments` module for creating, reading, updating, and deleting attachments.
- Introduced new classes such as `attachments`, `attachment_store`, `attachment_content`, and `attachment_relation` to handle attachment operations and their relationships.
- Integrated `attachments` features into `db_object_t` for seamless object-attachment interactions.
- Added `attachments_i` interface for standardized attachments module operations.
- Created `attachmentsRoute` for defining endpoints related to attachments.
- Enabled module configuration through `attachments_enabled_c` for attachment management control.
2025-09-22 10:28:22 +02:00
Jeppe Bundgaard c85c0d824c Extend License Plate Recognizer module with usage info endpoint and enhanced API handling
- Added `get_usage` method in `licenseplaterecognizer` to retrieve module usage statistics from the API.
- Introduced `licenseplaterecognizer_info` class to parse and manage API response data.
- Enhanced API request handling with updated default `api_url` and improved error handling.
- Refined cURL implementation for consistent API interaction.
2025-09-04 12:05:49 +02:00
Jeppe Bundgaard 81aa406fb6 Add License Plate Recognizer integration and vehicle product suggestion route
- Implemented `licensePlateRecognizer` module with configuration classes (`enabled`, `api_key`) and API handling.
- Introduced `moduleConfigRoute` endpoints for fetching and updating `licensePlateRecognizer` configurations.
- Added `vehicleProductSuggestionRoute` with logic to fetch product suggestions based on vehicle plates.
- Extended `moduleScannerRoute` with license plate recognition test and exception handling.
- Updated `index.php` to include `licensePlateRecognizer` class.
2025-09-01 10:11:37 +02:00
Jeppe Bundgaard 7a852f5b54 Add nullable return types and improve exception handling in MotorAPI
- Updated `getCachedResult` methods across `motorapi`, `motorapi_i`, and `motorapi_lookups_o` to return `?object` for nullable results.
- Enhanced error handling in `xlvask_parser_stor_bil` by wrapping `getLicensePlateInformation` in a try-catch block to handle API exceptions gracefully.
- Introduced `cleanJSON` method in `motorapi` to sanitize and validate JSON data, ensuring robust parsing of cached responses.
- Optimized `getCachedResult` logic to handle null and invalid JSON scenarios with detailed error reporting.
2025-08-31 13:33:10 +02:00
Jeppe Bundgaard c95116f2c9 Add float type support and SQL handling for float values in object properties
- Included `float` as a valid type in type validation.
- Added SQL update logic for handling float values in object properties.
2025-08-27 08:40:24 +02:00
Jeppe Bundgaard a0fd41fba1 Add image upload support, file handling improvements, and OpenAI integration
- Introduced `uploadRoute` to handle image uploads with MIME type validation and size restrictions.
- Added `upload_store` class for managing file storage and generating presigned URLs for upload/download.
- Enhanced file server to differentiate between PDFs and uploaded files, supporting dynamic content delivery.
- Integrated OpenAI module for License Plate Recognition (LPR), including API configuration and schema validation.
- Updated core structure with new interfaces (`minio_uploads_i`, `openai_i`) and classes (`openai`, `upload_store`).
- Adjusted `index.php` and file routes to support dynamic MIME checks and direct link generation.
2025-08-18 16:50:30 +02:00
Jeppe Bundgaard abd21e0ad7 Add OCR processing integration and module scanner routes
- Implemented `get_ocr_result` method in the `ocr_space` class to interact with the OCR Space API.
- Added `process_ocr` method to `image_processor_t` for handling OCR logic.
- Updated interfaces (`ocr_space_i` and `image_processor_i`) to support OCR functionality.
- Introduced `moduleScannerRoute` with endpoints for testing and license plate recognition workflows.
- Included data validation and exception handling for OCR processing.
2025-08-06 15:19:43 +02:00
Jeppe Bundgaard 69ceafcce6 Add OCR Space module with configuration and image processing support
- Introduced `ocrSpace` module with classes: `ocr_space`, `ocrSpace_c`, and configuration objects for `enabled` and `api_key`.
- Added routes for fetching and updating OCR Space configuration.
- Created `image_processor` class and interface for handling and processing base64-encoded images.
- Integrated new traits and classes for image validation and processing.
- Updated `index.php` to include `ocr_space` and `image_processor`.
2025-08-06 10:27:39 +02:00
Jeppe Bundgaard af3b0666fb Add import tasks and new parsers to XL Vask module
- Introduced `runImportTasks` method for vehicle, user, and usage log imports.
- Added new product parsers: `ht_b_rstel_s`, `ht_turbo`, and `ikke_b_rster_p_kabinen`.
- Implemented simulation and duplicate detection for usage logs via order objects.
- Updated usage log handling to include default customer checks and user association.
- Enhanced request handling with fast-link functionality for usage orders.
2025-07-21 10:32:56 +02:00
Jepp9350 ffd0606ece Enhance xlvask_tasks: introduce date range options and additional debug outputs for runSyncUsage. Add new parsers xlvask_parser_ingen_b_rster_foran_no_brush_wash_front and xlvask_parser_ht_dysebom and integrate into xlvask_helpers. Improve rate limiting and reduce FastCGI timeout in nginx configuration. Adjust execution time and memory limits in cli.php. 2025-07-14 09:22:32 +02:00
Jepp9350 6b80637208 Refactor InvoicingPeriodRoute and vehiclesRoute: streamline invoicing period data retrieval, enhance transaction handling across customer types, introduce new methods for efficient object construction, and add improved type validation in object_property. 2025-06-30 14:37:37 +02:00
Jepp9350 e0f582289f Refactor orders_o, InvoicingPeriodRoute, and object_property: enhance ID validation, streamline customer processing, and improve method structures for better data handling. 2025-06-26 16:55:37 +02:00
Jepp9350 75e3efcb89 Introduce xlvask_helper base class and refactor XLVask helper classes to extend it. Add methods for XLVask vehicle checks and retrievals, enhance vehicle caching functionality, and update helper class instantiation logic. 2025-06-19 11:06:53 +02:00