Commit Graph
23 Commits
Author SHA1 Message Date
Jeppe Bundgaard 4cc270e258 Refactor order creation to use addArray method and sanitize inputs
- Introduced `addArray` method in `orders_o` for streamlined order creation using an associative array.
- Updated `ordersRoute` to utilize `addArray`, replacing older implementation for better manageability.
- Improved input handling by trimming whitespaces from registration numbers.
- Enhanced product pricing by incorporating department-specific prices and discount percentages.
2025-07-21 13:10:15 +02:00
Jepp9350 5b88ef9dc3 Refactor order and order item management: add cache invalidation, improve object change tracking, and enhance asArray conversion with caching and expiration support. 2025-06-26 08:55:58 +02:00
Jepp9350 b837f572af Add handling for forced prices, arrays, and improved type checks
Introduced support for forced pricing in `addItemToOrder` and added stricter validation for array inputs in SQL queries. Enhanced JSON handling in type validation and improved code reuse with new objects. Added new endpoint `/modules/xlvask/related-orders` to fetch related orders by wash IDs.
2025-05-22 22:51:05 +02:00
Jepp9350 b42c864bff Add wash_id property and support for listing own orders
Introduced a new `wash_id` property to the `orders_o` object and updated related order handling logic. Implemented functionality to restrict users to only list their own orders if they lack permissions to view all orders. Updated permissions and adjusted queries accordingly.
2025-05-22 10:27:09 +02:00
Jepp9350 8d2fe8d75d Add support for closed_at field in order invoices
Introduce the closed_at field to track closure dates for order invoices. Updated validation, processing logic, and database integration to ensure correct handling of the new field. Adjusted related routes to pass and store the closed_at value where applicable.
2025-05-01 15:45:59 +02:00
Jepp9350 6cc5e6bbf0 Add custom routes, subscription features, and refactor orders
Introduced a new POST route for collected vehicle subscription invoices and enhanced responses with wash subscription transactions. Refactored order handling by adding department-based pricing logic and simplifying reusable methods. Various minor improvements include exception handling, input validation, and updated permissions.
2025-04-28 14:24:11 +02:00
Jepp9350 c19ed3389c Update permission check for Stripe payment intent
Replaced 'charge_order_stripe' with a more general 'charge_order' permission check in the Stripe payment intent endpoint. This ensures consistent permission handling across payment modules.
2025-04-28 09:01:15 +02:00
Jepp9350 60de6ae998 Add Stripe payment capture functionality
Introduced methods to handle Stripe payment capture and updated related classes and endpoints. Refactored constants for payment processors and integrated order collections to reflect Stripe payments. Ensured robust error handling and session validation for payment operations.
2025-04-22 10:17:06 +02:00
Jepp9350 d2201448c1 Add Stripe payment intent simulation endpoint for testing
This new endpoint allows simulating Stripe payment intents for debugging purposes. It includes validation checks for session, order existence, and payment intent status, ensuring controlled execution. This functionality is intended strictly for testing and should not be used in production environments.
2025-04-09 10:58:13 +02:00
Jepp9350 e4ec92d66c Add Stripe payment intents support and product subscription flag
Introduced functionality for handling Stripe payment intents, including creation, retrieval, and cancellation. Added a subscription_allowed flag to products for enabling subscription-specific operations. Integrated the necessary backend endpoints, object property updates, and route handling logic.
2025-04-08 14:11:11 +02:00
Jepp9350 60bcbb6e75 Enhance invoice handling and filtering mechanisms
Refactored invoice draft handling to improve error checks, added support for optional fetch skipping, and enhanced currency management. Expanded filtering capabilities with date range and attribute-based filters. Adjusted Nginx config to increase FastCGI read timeout for long-running processes.
2025-04-07 07:43:47 +02:00
Jepp9350 48bb2c194c Add feature to mark orders as completed
Implemented a new endpoint to mark orders as completed and updated the `orders_o` object with the necessary logic and database integration. Added a `completed_at` property to track when an order is marked as completed. Includes validation, error handling, and logging to ensure proper functionality.
2025-03-27 14:38:48 +01:00
Jepp9350 32f0a1548f Add customer-specific filtering and refactor order invoice logic
Introduced customer attribute-based filtering for individual invoicing and enhanced collected order invoice processing with proper associations to customers and orders. Added new endpoints, fields, and utility methods to streamline data retrieval, ensure consistency, and support new use cases like 'Ready to Invoice'. Includes minor fixes, validations, and optimizations throughout the affected modules.
2025-03-13 14:35: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 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 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 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 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 797630d8bd Add backup and email enhancements with PHPMailer integration
Introduced a backup system managing database and metadata files using Minio/S3, alongside routes for handling these. Integrated PHPMailer for robust email functionalities, including configuration testing and SMTP handling. Updated Dockerfile, composer dependencies, and minor code improvements to support new features.
2025-02-11 14:25:26 +01:00
Jepp9350 588c9d68ef Remove unused '/orders/pending' route from ordersRoute.php
This route was unused and marked with a TODO for removal. Its deletion simplifies the code and eliminates unnecessary maintenance for an unused endpoint.
2025-02-06 14:28:19 +01:00
Jepp9350 ad2075a7d1 Update order and invoice handling logic
Added functionality to retrieve and list pending orders, as well as improved invoice draft management based on customer preferences (e.g., invoice per order). Simplified error handling and removed redundant operations in economic invoice logic.
2025-02-06 14:27:09 +01:00
Jepp9350 f2dcb6e5ba Add draft invoice handling and enhance endpoint functionality
Introduced endpoints and routes for managing draft invoices, enabling retrieval and updates. Extended object handling to include filters for deleted entries and added custom parsing for pagination results. Refactored code for improved structure and consistency.
2025-02-06 11:57:42 +01:00
Jepp9350 707df910b0 Refactor: migrate files 2025-01-29 14:27:44 +01:00