- 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.
- 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`.
- Updated `addNote` in `users_o` to return the `customer_notes_o` object.
- Modified `customerNotes` endpoint to include note details in the success response.
- Introduced `asArray` method in `customer_notes_o` for structured API responses.
- Introduced `search` method in `economic_customers_endpoint` to retrieve customers based on filters and pagination parameters.
- Enhanced response handling with JSON decoding for structured data retrieval.
- Simplified department retrieval in `economic_invoice_draft.php` by streamlining logic for default department usage.
- Enhanced `getDepartmentByOrderId` in `orders_o` to ensure correct department is fetched based on given `order_id`.
- Updated discount line logic to leverage appropriate department dimension values.
- Enhanced `getTransactionsWithItemsNotIncludedInInvoices` to aggregate total subscription prices and calculate department-based distribution.
- Added processing to parse department IDs into human-readable names.
- Updated response to include aggregated subscription results under `collective_subscription_results`.
- Introduced `add_environmental_and_oil_fees` in `economic_invoices_draft_endpoint` to compute and add fees to drafts.
- Added `addEnvironmentalAndOilFeesToDraft` in `collected_order_invoices_o` to conditionally apply fees for customers with the `onlyTankCleaning` attribute.
- Added `attemptSubscriptionFallbacks` method in `InvoicingPeriodRoute` to handle vehicle subscription fallbacks through department-based strategies.
- Enhanced `customer_vehicles_o` with `getLastTransactions` for retrieving recent transactions.
- Updated `users_o` to support nullable return type for `getDefaultDepartment`.
- Introduced new endpoints for invoicing distribution: `/superuser/invoicing/period/distribution/fixed-pricing` and `/superuser/invoicing/period/distribution/wash-subscriptions`.
- Enhanced `customer_vehicles_o` with `getSubscriptionAppliedTransactionsFromList` method for transaction filtering based on subscriptions.
- Added `getNetAmountForOrderItemsOriginal` to `orders_o` for calculating the original net amount of order items.
- Introduced parsing utilities for department-based aggregation in invoicing.
- Extended `products_o` with `getSubscriptionMonthlyPrice` to calculate subscription pricing.
- Added `getFieldsWhereIn` to `db_object_t` for advanced database querying.
- Introduced `is_handheld` field in order creation to identify orders from handheld devices.
- Added logic to set, cache, and expire pending handheld orders automatically at midnight.
- Enhanced `orders_o` class with `setPendingHandheldIndicator` and `isPendingHandheld` methods.
- Updated order processing flow to include `pending_handheld` indicator in responses.
- Added `objectChanged()` to notify the order object when items are updated or deleted.
- Refactored `delete()` method to ensure the order is informed before executing the database query.
- 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.
- Introduced new endpoint `/worker/licenseplates` to fetch and analyze distinct license plates from multiple database tables.
- Added functionality to format license plates by removing non-alphanumeric characters and converting them to uppercase.
- Integrated response to include counted plates and total unique plates.
- Improved database query logic to handle multiple tables and columns for license plate retrieval.
- Updated `file_server.php` to mark files with `temp_file_` in their name as attachments.
- Enhanced routing logic in `index.php` to load `file_server.php` for `/files/` requests.
- Introduced `preview` query parameter to enable inline file display.
- Adjusted content headers to differentiate between preview and download modes.
- Improved file name handling by removing query strings from URLs.
- 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.
- 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.
- Added logic to determine if a known vehicle has been assigned to a specific customer and retrieve the customer name.
- Integrated checks to handle barred customers by resetting vehicle status to `unknown` and clearing customer details.
- Ensured support for scenarios with multiple known customers, marking vehicles accordingly.
- Introduced methods to apply customer-specific discounts and department-based pricing to products and addons.
- Enhanced `productsRoute` to handle optional parameters (`customer_id`, `department_id`, `category`, `id`) for tailored pricing and filtering.
- Updated response generation to include adjusted prices for both products and options based on customer and department context.
- Added helper methods to streamline parameter validation and parsing in `productsRoute`.
- Extended `products_o` to support discount application logic for customer pricing.
- Introduced a new route `/vehicles/search` to enable searching for vehicles by registration number across multiple categories (e.g., verified, known, booked, unknown).
- Added validation for search parameters, including length and format checks.
- Ensured proper classification of vehicles with clear prioritization and deduplication logic.
- Implemented helper methods to retrieve matching registrations from various sources like bookings, orders, and scanned plates.
- Enhanced response format to include vehicle status, customer details, and references for improved usability.
- Introduced a new route `/vehicles/status` to provide detailed vehicle status, including verification, booking, and last order information.
- Added `getLastOrderByPlate` method in `customer_vehicles_o` to retrieve the last order for a vehicle plate.
- Implemented validation for registration number and optional department parameter.
- Enhanced response with multiple status indicators like `verified`, `known`, `booked`, and `card`.
- Introduced `/account/security/change-password` route to handle password updates.
- Enforced user login and required parameters (`current_password`, `new_password`) for validation.
- Added password validation logic, including constraints on old and new password similarities.
- Integrated logging and detailed error handling for invalid sessions, passwords, and operations.
- Updated user model to support secure password changes.
- Integrated `customer_vehicles_o` to validate vehicle type using customer-based data.
- Added fallback logic in `selectByPlate` to handle exceptions gracefully.
- Enhanced `checkMotorAPI` error handling by returning `false` instead of throwing exceptions.
- Integrated `customer_vehicles_o` to validate vehicle type using customer-based data.
- Added fallback logic in `selectByPlate` to handle exceptions gracefully.
- Enhanced `checkMotorAPI` error handling by returning `false` instead of throwing exceptions.
- 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.
- Introduced `getTransactionsOnDateWaterUsage` method in `department_daily_reports_o` to calculate water usage based on transactions for a given date or date range.
- Updated department daily reports routes to include `water_usage` in the output.
- Introduced `is_wash` field to `products_o` for marking wash-related products.
- Updated `productsRoute` to handle `is_wash` in product creation and editing.
- Added `getTransactionsOnDateWashesCount` method in `department_daily_reports_o` for calculating wash-related transactions in reports.
- Adjusted department daily reports routes to include wash statistics output.
- Introduced optional `date_to` parameter across relevant routes and methods for handling date ranges in department daily reports.
- Added `getDate_to` method and refactored date validation logic into `validateDateLocally` for reuse and reduced redundancy.
- Updated SQL queries in `department_daily_reports_o` to support date range queries using `BETWEEN`.
- Enhanced error handling and parameter validation for date-related inputs.
- Cleaned up comments and redundant code for improved readability.
- Deleted the `/modules/scanner/test` route, including unused cURL implementation and base64 image logic.
- Cleaned up related comments and redundant code.
- Updated comments to reflect future usage plans with OpenAI integration.
- 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.
- 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.
- Introduced `latitude` and `longitude` properties in `departments_o` for geographic data support.
- Updated department routes to handle latitude/longitude in responses and parameter updates.
- Adjusted serialization and object creation to include new properties.
- Enhanced `orderInvoicesRoute` with `reset`, `unlink`, and `remove-special-arrangements` handlers for invoice actions, improving E-Conomic integration.
- Added `resetPricesOfItemsNotIncludedInInvoice`, `setAllItemsToBeIncludedInInvoice`, and `unlinkFromEconomic` methods in `collected_order_invoices_o` for robust invoice control.
- Introduced `getCustomerProductPrice` in `orders_o` to calculate customer-specific product pricing with discounts.
- Added `getCachedResultsBySubstring` in `motorapi_lookups_o` for efficient cached lookup based on result substrings.
- Set default values for `min` and `max` when null (`0` and `-1` respectively).
- Added `price` property to the output array for enhanced product data completeness.
- 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.
- 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.
- 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`.
- Updated `orders_o` to use `round` for consistent discounted price calculations.
- Refined `xlvask_parser_stor_bil` with MotorAPI-based vehicle type validation and added `checkMotorAPI` method.
- Optimized `motorapi_lookups_o` license plate validation to streamline database queries.