Commit Graph
1678 Commits
Author SHA1 Message Date
Jepp9350 f045611794 Add form handling system for dynamic form operations
Implemented a robust form management system with validation, sanitization, and database integration. Added reusable traits, classes, and methods to define, submit, and process forms. Introduced a "Book a Wash" form as an example implementation.
2025-03-12 14:35:21 +01:00
Jepp9350 aa07219b7a Add method to retrieve customer payment terms number
Introduced `getPaymentTermsNumber` method in the customer helper to fetch payment terms directly from the customer object. Refactored invoice drafts endpoint to use this method, ensuring cleaner and more reliable access to payment terms data.
2025-03-10 16:48:32 +01:00
Jepp9350 48ad281baa Add notifications module with routes, types, and helpers
Introduced a complete notifications module, including classes for managing notifications (`notifications_o`), traits for handling types and routing, and API routes to list, add, and delete notifications. Added input validation, permission handling, and JSON data processing capabilities.
2025-03-10 13:11:44 +01:00
Jepp9350 fdb536ea3e Add user data to collected order invoices array
Include customer user data in the collected order invoices payload by retrieving user information based on customer number. This ensures that relevant user details are available for further processing or integration.
2025-03-07 16:45:12 +01:00
Jepp9350 b3c4e9696f Refactor invoice handling and add total net amount calculation
Introduce logic for validating booked and draft invoices in E-conomic. Add methods to calculate the total net amount for invoice collections and improve error handling for specific invoice states. Updated related workflows to ensure consistent validation and data integrity.
2025-03-07 16:22:14 +01:00
Jepp9350 d160ecbb63 Add min and max fields to product options
This commit introduces support for `min` and `max` fields in product options. It includes backend changes to handle validation, setting, and retrieval of these new fields, ensuring compatibility. Additionally, a new `requireTypeIn` utility and `TYPE_NULL` constant were added for improved type validation.
2025-03-07 12:29:45 +01:00
Jepp9350 370760fbd3 Normalize data types for user prices and product attributes
Updated user price overrides and product attributes to enforce consistent data types. This improves data handling clarity and reduces type-related errors across the application.
2025-03-07 11:23:50 +01:00
Jepp9350 cc23c83aaf Add support for adding notes to order items.
Extended the `addItemToOrder` method to accept an optional `notes` parameter and updated relevant logic to handle it. Modified input validation in `orderItemsRoute` to ensure notes are a valid string. Adjusted `set_name` in `product_options_o` to handle empty strings by nullifying the name.
2025-03-06 16:05:14 +01:00
Jepp9350 02a5b811bc Add support for 'requires_note' property in products module
Introduced a new 'requires_note' property to the product object, including its initialization, serialization, and integration in relevant routes. This change ensures the property can be set, retrieved, and properly processed in API requests. It also updates logging to capture changes to this field when editing products.
2025-03-06 14:49:33 +01:00
Jepp9350 2038547d1c Enhance department report handling with date support
Added date parameter support for department daily reports, including validation, new functions, and route updates. Improved functionality allows fetching or creating reports for specific dates and prevents duplicate entries for the same date. Introduced a standardized date format within the API.
2025-03-06 14:37:32 +01:00
Jepp9350 9e7984b93a Cast department_id to integer in orders object
Ensure department_id is explicitly cast to an integer to prevent potential data type issues. This change improves type consistency and ensures reliability when processing order data.
2025-03-06 11:19:09 +01:00
Jepp9350 ec9f760bea Add user key management routes and enforce user context checks
Introduced GET and POST routes for managing user key-value pairs, restricted for administrative use. Added strict user context verification in `user_key_value_pairs_o` methods to ensure valid `user_id` is selected before operations. This enhances security and maintains data integrity for user-related actions.
2025-03-05 13:44:30 +01:00
Jepp9350 0d87b7acdd Add product option deletion functionality
Implemented endpoint and logic for deleting product options, ensuring user authentication, parameter validation, and proper logging. Added a delete method in the product options object to permanently remove records.
2025-03-05 11:54:17 +01:00
Jepp9350 a02729d5c6 Add module action handling and license plate lookup logging
Implemented `module_action_t` trait to standardize module actions with validation, logging, and execution. Added `module_action_logs_o` for logging module actions and integrated `license_plate_lookup_a` in motorapi for license plate lookup requests. Enhanced error handling to log failed actions and provide detailed feedback.
2025-03-05 11:11:09 +01:00
Jepp9350 cb62c66e5b Add earnings calculation and enhance department data handling
Introduced a method to calculate department earnings on a given date. Enhanced department object with new properties (dimension, created_at, updated_at) and improved data serialization for flexibility. Updated routes to accommodate these additions for more robust department insights.
2025-03-04 16:23:13 +01:00
Jepp9350 d6ed51f9ba Add endpoint to fetch the latest department daily report
Introduced a new method in `department_daily_reports_o` to select the latest daily report for a department. Added a corresponding API route to fetch the latest report details for a given department ID, with appropriate validations and access control measures. Adjusted parameter handling logic to enhance request validation.
2025-03-04 15:19:40 +01:00
Jepp9350 bf4879e593 Enhance product options and invoice data handling
Added support for `name`, `created_at`, and `updated_at` fields in product options API response for better data visibility. Updated invoice object logic to conditionally set draft and booked IDs based on `external_id`, improving flexibility and accuracy in handling external integrations.
2025-03-04 14:04:46 +01:00
Jepp9350 4d593c2b17 Add department daily reports feature and improve product handling
Introduced functionality for managing department daily reports, including endpoints for creating, updating, listing, and viewing product sales data. Enhanced product handling in reports by adding support for water usage, notes, and detailed product sales metrics. These changes improve tracking and reporting accuracy across departments.
2025-03-04 11:39:38 +01:00
Jepp9350 9d005566cc Refactor permissions and add department daily reports feature
Updated customer search route permission for clarity and introduced new functionality to manage and retrieve department daily reports. Added `department_daily_reports_o` object and associated route for handling reports, including permission checks, logging, and support for pagination.
2025-03-04 08:32:49 +01:00
Jepp9350 8928cd375a Add booked_invoice_id property and optimize invoice handling
Introduce the booked_invoice_id property in collected_order_invoices_o for improved invoice management. Optimize performance by avoiding redundant requests to external systems when the booked_invoice_id is already set. Enhance routes to include the booked_invoice_id in relevant responses and ensure a consistent structure for associated data.
2025-03-04 08:24:33 +01:00
Jepp9350 bad6a62a5a Add closed_at field to order serialization
The `closed_at` field is now included when serializing order data. This provides additional context regarding the closure state of invoices in the order, enhancing data accessibility and utility.
2025-03-03 17:24:12 +01:00
Jepp9350 9e46140373 Add support for handling economic invoice drafts/booked IDs
Added methods to check and retrieve economic invoice draft and booked IDs, improving invoice tracking functionality. Introduced a new method in the economic endpoint to fetch booked invoice details using external IDs. Additionally, updated the object property class to handle integer values during SQL updates.
2025-03-03 16:55:09 +01:00
Jepp9350 68b3fd2171 Add customer detail accessors and update usage in endpoints
Added individual getter methods for customer details such as name, email, address, zip code, city, and country in the economic_customer module. Updated the invoices drafts endpoint to use these accessors instead of directly accessing properties. Included an exception throw for failed requests in the endpoint.
2025-03-03 16:00:23 +01:00
Jepp9350 2042f0c00a Add capability to sync collected invoices to E-Conomic
Introduced a new endpoint for syncing collected order invoices with E-Conomic via a POST route. Added methods for creating, managing, and closing invoice drafts in E-Conomic. The implementation includes validations, external ID handling, and seamless integration of payment terms and layout configurations.
2025-03-03 15:36:58 +01:00
Jepp9350 dc419e1715 Remove unused MotorAPI license plate lookup endpoint
The `/modules/motorapi/lookup` route has been removed as it is no longer needed. This cleanup reduces codebase clutter and eliminates outdated or redundant functionality.
2025-03-03 12:18:36 +01:00
Jepp9350 b66c598f83 Add external ID generation and update user route actions
Introduce methods to generate and retrieve unique external IDs for collected order invoices, ensuring UUID-based uniqueness. Update user route actions to include new functionalities for editing user roles and passwords.
2025-03-03 10:58:55 +01:00
Jepp9350 e9aeedc327 Add invoice collection assignment logic to orders and users
Introduced methods to manage, assign, and retrieve invoice collections for orders and users. Enhanced the system to support flexible invoice grouping, including per-order logic and automated assignment to open or newly created invoice collections.
2025-02-28 13:50:27 +01:00
Jepp9350 9bf0355e47 Add routes and objects for managing collected order invoices
Introduced GET and POST endpoints for collected order invoices, enabling listing and creation functionalities for authorized users. Added a new database object to handle invoice-related operations and validations. Included utility functions to enforce parameter requirements and data integrity.
2025-02-28 12:07:46 +01:00
Jepp9350 7497e0c744 Fix undefined filter check in db_object_t trait logic
Ensure the filter is set before validating its value against allowed options. This prevents potential undefined index errors when filters are not provided.
2025-02-28 11:04:22 +01:00
Jepp9350 72df11e345 Simplify permission handling in group addition.
Removed unnecessary array key access for permissions in the loop. This improves code readability and ensures the permission object is directly passed without intermediate referencing.
2025-02-28 09:30:25 +01:00
Jepp9350 2fca599599 Add role cloning functionality and adjust permission methods.
Introduced a method to clone groups with their permissions and added a corresponding API endpoint for role cloning. Adjusted existing permission methods to ensure consistent behavior and naming, swapping the implementation of add/remove permissions. Improved permission fetching logic for cleaner data handling.
2025-02-28 09:27:06 +01:00
Jepp9350 491f268108 Add role and permission management with enhanced access control
This update introduces functionalities for managing roles, permissions, and access control across departments. Key additions include methods for filtering, restricting, and handling user permissions, as well as new APIs for assigning/removing permissions to/from roles. Access to resources like orders, bookings, and plate scans is now securely tied to department-specific permissions.
2025-02-27 17:54:18 +01:00
Jepp9350 d430f6ff7f Add support for related item ID in order items
Enhanced the order items functionality to include a related item ID. This involved adding a new property, updating methods to handle the related item ID, and ensuring appropriate validation and sanitation in the API routes. Also improved input sanitization for motorapi lookups to prevent SQL injection risks.
2025-02-25 18:06:57 +01:00
Jepp9350 8b4187295c Handle token retrieval from JSON body in authentication.
Added support for extracting the token from JSON-formatted request bodies (`php://input`). This ensures compatibility with clients sending tokens in the request payload alongside other existing methods.
2025-02-24 11:59:35 +01:00
Jepp9350 b6a345edb2 Handle token authentication using POST parameters.
Previously, only tokens from headers or GET parameters were accepted. This update adds support for tokens sent via POST parameters, ensuring compatibility with more request types and improving flexibility for clients.
2025-02-24 11:18:03 +01:00
Jepp9350 da9ebbc160 Add vehicle type support and recommended order logic
Introduced vehicle type handling in `motorapi` with a helper class. Integrated recommended order logic based on vehicle plate and order history, enhancing order and department route functionality.
2025-02-21 17:28:48 +01:00
Jepp9350 d2c1cdda9a Add Stripe terminal and department variables API endpoints
This update introduces new endpoints for managing Stripe terminal readers, locations, and department-specific configurations. It also adds support for creating, updating, and retrieving department variables along with enhanced validation, logging, and permission checks. These updates improve integration and expand functionality for Stripe and department-related operations.
2025-02-21 14:43:33 +01:00
Jepp9350 ff12fbcbd0 Add Stripe endpoint for listing terminal readers
Introduced a new `stripe_endpoint_readers` class to handle terminal readers, with a `list` method to retrieve all reader data. Integrated this endpoint into Stripe module routes and updated dependencies to support terminal-related
2025-02-21 09:42:53 +01:00
Jepp9350 9e8f3f7088 Add corporateIdentificationNumber to filterable properties
This update enhances the filtering capabilities by including 'corporateIdentificationNumber' in the list of supported properties for search. It improves the flexibility of customer queries and ensures better alignment with user needs.
2025-02-21 09:42:42 +01:00
Jepp9350 2aa0854d3a Update sync interval for economic discounts to 1 minute
Changed the execution interval of `SyncUserEconomicCustomerDiscounts` from 10 minutes to 1 minute. This ensures more frequent updates and improves data synchronization accuracy.
2025-02-21 08:39:13 +01:00
Jepp9350 adc44eee9b Update description for 'get_user_id' route
Clarified the purpose of the 'get_user_id' route by specifying that it retrieves the user ID from the e-conomic customer number. This improves code readability and developer understanding.
2025-02-21 08:39:02 +01:00
Jepp9350 c95daeb619 Remove permissions from worker status API response.
The 'permissions' field has been omitted from the worker status API response payload. This ensures a more streamlined response and avoids exposing unnecessary data. The change does not affect the functionality of the API.
2025-02-20 17:13:59 +01:00
Jepp9350 9ce0dcd35c Add backup functionality to cron scheduler
Introduced a new "backup" task that runs every 12 hours. The task uses the backup_store class to create backups and handles exceptions gracefully by logging errors. This ensures regular backups and improves system reliability.
2025-02-20 17:11:57 +01:00
Jepp9350 367dfc44e4 Add role and permission management functionality
Introduce classes `groups_o` and `groups_permissions_o` for managing roles and permissions. Add new routes `rolesRoute` and `permissionsRoute` to handle role and permission-related operations. Enhance `users_o` with the `getGroup` method and update `db_object_t` for improved table handling and pagination support.
2025-02-20 17:04:35 +01:00
Jepp9350 d28cb172a0 Add permission definitions to route handlers
This update introduces explicit permission definitions for various route handlers across multiple routes. These changes enhance clarity and allow for more granular control over route access based on defined permissions. The updates ensure better manageability and scalability of endpoint permissions.
2025-02-20 14:33:42 +01:00
Jepp9350 d9638406d3 Implement route-level permission handling.
Added support for defining and registering permissions for API routes. Updated methods across the router and route traits to accommodate permission details, enabling better access control. Enhanced department license plate lookup with session validation and additional endpoints.
2025-02-20 14:12:21 +01:00
Jepp9350 b659b07d4c Add caching support for license plate lookups in MotorAPI
Introduced caching functionality to improve efficiency and reduce redundant API calls for license plate lookups. Added methods to check and retrieve cached entries while ensuring proper validation. Enhanced error handling for invalid responses and updated related routes and interfaces accordingly.
2025-02-20 10:59:09 +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 53b61654bf Add Stripe invoice generation and customer management
Introduced functionality for creating and managing invoices using Stripe APIs, replacing the previous payment link system. Added customer account creation and retrieval, invoice line-item handling, and extended database object structures to support invoices. Updated order routing to include Stripe customer and invoice details.
2025-02-19 17:25:19 +01:00
Jepp9350 ea6c675826 Add support for Stripe economic customer number.
Introduced a new configuration variable `stripe_economic_customer_number_c` to handle the Economic customer number for invoicing. Updated the Stripe module to include this variable in initialization and allow updates. This enhancement enables better integration with invoicing workflows.
2025-02-19 14:16:17 +01:00