Commit Graph
63 Commits
Author SHA1 Message Date
Jepp9350 58c50233d5 Add order update functionality via PUT endpoint
Introduced a new PUT /order route allowing authenticated users to update orders. Added `updateRequest` method in `orders_o` to process update requests, handle validations, and apply changes. Ensured proper error handling for missing or invalid inputs.
2025-01-23 10:52:42 +01:00
Jepp9350 cfb4689c4d Add cache clearing after token deletion
Ensure token consistency by clearing it from the cache after deletion from the database. This prevents potential issues with stale data in the caching layer.
2025-01-22 17:48:15 +01:00
Jepp9350 7c8306004e Add language pack support and improve token caching
Introduced language pack functionality with default and user-specific translation handling. Enhanced token caching in Redis for improved performance. Refactored logging system to display progress during database synchronization.
2025-01-22 17:46:15 +01:00
Jepp9350 0ab9c1fd52 Use setEx to add expiry to customer discount cache.
Previously, the customer discount cache lacked an expiry time, which could lead to stale data. This change ensures the cached value expires after 60 seconds, improving cache reliability.
2025-01-22 09:04:05 +01:00
Jepp9350 07627e6db7 Add WORDPRESS_API_URL to config example file
Introduced a new global variable, WORDPRESS_API_URL, for defining the WordPress API ajax endpoint. This change ensures better configuration clarity and simplifies setup for WordPress integration.
2025-01-21 22:28:47 +01:00
Jepp9350 4763cf55ff Refactor logging and Redis integration for efficiency
Updated logging to use prepared statements, improving security and performance. Refactored Redis-related functions for flexibility, added timing for sync operation, and ensured proper cache cleanup after log synchronization. Simplified `clear_keys` and enhanced code readability throughout.
2025-01-21 22:25:32 +01:00
Jepp9350 b794e95ba9 Refactor and enhance booking, customer, and caching logic
Improved booking handling with unfulfilled booking checks and Slack notifications. Enhanced customer data retrieval with caching optimizations and discount calculations. Added logging, debug capabilities, and expanded Redis functionalities for better data management.
2025-01-21 21:16:42 +01:00
Jepp9350 635ad0fa04 Add booking synchronization and API integration
Implemented methods for booking synchronization, including fetching, parsing, and updating bookings from a remote API. Added caching mechanisms and data validation for customer names, department names, and booking details. Integrated new API trait and remote booking class to improve scalability and enable automated tests for booking modules.
2025-01-20 15:49:08 +01:00
Jepp9350 851d5f3e4c Add caching and Slack notification enhancements
Implemented caching for department and customer names to improve performance. Added Slack notifications for new bookings with detailed formatting. Refactored related methods to streamline functionality and ensure better code clarity.
2025-01-20 08:08:18 +01:00
Jepp9350 f256e05c3d Add Redis caching, Slack notifications, and booking logic.
Implemented Redis caching for improved department and customer data retrieval. Added Slack integration to send department notifications. Enhanced booking features and status handling, including parsing logic and wash certificate processing.
2025-01-17 08:39:20 +01:00
Jepp9350 34fc194df1 Add Redis integration and improve order processing
Introduces Redis integration with a client class, traits, and interface for caching and object persistence. Adds Redis tests, updates `composer` to include Predis, and extends configurations to support Redis. Implements a new `delete` method for bookings and enhances pagination to include order details.
2025-01-16 11:27:19 +01:00
Jepp9350 a794203456 Add support for direct certificate download via justDownload
Introduced functionality to handle `justDownload` parameter, allowing direct retrieval of certificate download URLs for a given booking ID. Updated comments and made minor adjustments to file cleanup logic by disabling certificate deletion.
2025-01-15 18:36:44 +01:00
Jepp9350 30f30c66ba Refactor wash certificate handling and add user access checks.
Simplified wash certificate storage logic by updating methods for file existence checks and download link generation. Added validation to ensure users can only access their own wash certificates. Introduced a route for downloading wash certificates with proper permissions and error handling.
2025-01-15 15:16:43 +01:00
Jepp9350 0413071432 Add Minio integration for wash certificate storage
Introduced Minio support to store and manage wash certificates, replacing local file storage. This includes implementing traits, interfaces, and a Minio client integration, along with a CLI utility and relevant tests. Updated relevant modules and configurations.
2025-01-14 10:56:50 +01:00
Jepp9350 d62e3fa17a Add composer.lock file to track dependency versions
This commit introduces the `composer.lock` file to ensure consistent dependency versions across environments. It captures the precise versions of installed packages, enhancing reproducibility and minimizing potential conflicts during deployments.
2025-01-14 09:24:55 +01:00
Jepp9350 2a35b7ce4d Refactor pagination and filtering logic
Replaced redundant SQL queries with reusable methods for paginating, filtering, and searching records. Improved query safety using prepared statements and enhanced flexibility with dynamic order and filter processing. Updated related routes and objects to support the new structure.
2025-01-13 15:50:09 +01:00
Jepp9350 8bde53cf82 Update filtering logic, tokens, and wash certificate handling
Refine db_object_t filtering to handle numeric vs. string values. Add a new token for wash certificate authentication and update routes to include it in responses when applicable. Adjust data type for pickup_bool in bookingsRoute handling.
2025-01-13 13:22:39 +01:00
Jepp9350 ea6c65a7b8 Add Wash Certificate generator module.
This commit introduces the Wash Certificate generator, including template files, images, fonts, and outputs necessary for certificate generation. These assets and configurations support creating customized wash certificates effectively.
2025-01-10 15:20:26 +01:00
Jepp9350 5d06849a64 Add public employees route and user permission methods
Introduced a new public route to fetch public employee data based on specific permissions. Added helper methods in `users_o` for fetching users in a group, listing public employee data, and getting users with specific permissions. Adjusted formatting for better readability in existing checks.
2025-01-10 14:16:17 +01:00
Jepp9350 d7174ce29e Add endpoint for unfulfilled department bookings count
Introduced a new method to fetch unfulfilled bookings count by department in `bookings_o`. Added a corresponding route in `bookingsRoute` to expose this functionality via an API endpoint. Validations and logging were also implemented to ensure proper usage and tracking.
2025-01-10 13:01:50 +01:00
Jepp9350 6bcf310bf3 Refactor logging message for plate scans addition.
Updated the log message in plate scans flow to include a clearer format by adding a colon before the plate data. Also removed an unused import for better code cleanliness.
2025-01-10 12:18:19 +01:00
Jepp9350 2a64aa0e84 Refactor user handling and improve data validation.
Reorganized class properties for better accessibility and added a `nullify` method for handling null values in the database. Enhanced customer handling logic to prevent duplicate records and ensure password nullification. Improved password validation and user authentication checks for stricter input handling.
2025-01-10 11:50:28 +01:00
Jepp9350 482fc9256e Ensure numeric validation and apply department-specific pricing.
Added numeric validation for `order_id` and `customer_number` in API routes to prevent invalid input. Implemented department-based pricing adjustments for order items across relevant endpoints, enhancing pricing accuracy based on department configurations.
2025-01-10 11:00:43 +01:00
Jepp9350 5c9d7d08f2 Refactor price retrieval for order items by department.
Replaced direct SQL fetching with object methods to retrieve product prices based on department. Added `getDepartmentPrice` method in `products_o` for cleaner and more reusable code. This enhances maintainability and aligns with object-oriented principles.
2025-01-10 09:47:49 +01:00
Jepp9350 2c1b74b926 Update token creation logic in intimidateRoute
Replaced `create_token` with `create_employee_token` to align with the use of `user_id` instead of `customer_number`. Removed unused `tokens_o` import to clean up dependencies.
2025-01-10 09:36:10 +01:00
Jepp9350 19b9a9616d Add department-specific product pricing and API routes
Introduce functionality to set, fetch, and apply department-specific product prices. Enhanced the API with routes for superusers to manage department pricing, including endpoints to set prices, fetch prices, and retrieve department details.
2025-01-10 09:34:33 +01:00
Jepp9350 ef293b2509 Add employee login functionality to authentication flow
Introduced a new endpoint for employee login in `authRoute.php`, including validation, credential checks, and token generation. Enhanced the `authentication` class to support employee authentication and token creation, ensuring secure handling of employee credentials. Additionally, improved customer authentication logic and refactored password matching for reuse.
2025-01-10 09:33:30 +01:00
Jepp9350 8d7b14df43 Enhance discount handling for category inheritance.
Added support for products to inherit discounts from categories if configured. Updated relevant methods, classes, and routes to handle conditional application of category discounts and improved logic for managing price overrides.
2025-01-09 14:01:00 +01:00
Jepp9350 51c5e53c6a Add functionality for managing custom user discounts
Introduced API endpoints to set and retrieve user-specific discounts. Integrated discount logic into orders, with adjustments based on category or product. Added a new object `user_price_overrides_o` for handling price overrides along with relevant updates to existing classes.
2025-01-08 15:31:02 +01:00
Jepp9350 eec7a17672 Handle open invoice drafts and improve order-fetching
Added logic to handle open invoice drafts for customers, allowing draft reuse or creation as needed. Enhanced user order-fetching with permission checks and validation. Refactored related methods for better code structure and consistency.
2025-01-07 15:28:02 +01:00
Jepp9350 aab80bb75f Add user attributes handling to users_o and API response
Refactored `getUserAttributes` and moved it within `users_o` class for a cleaner structure. Introduced proper assignment of attributes to the `attributes` array in the class. Enhanced API response to conditionally include user attributes based on request parameters.
2025-01-07 12:03:39 +01:00
Jepp9350 1d03ee25ef Add vehicle plate order history route and data retrieval
Introduced a new route to fetch the last five orders for a vehicle using its plate. Implemented a corresponding method in the `orders_o` class to query order history based on vehicle plates, supporting dynamic entry limits. This enhances functionality for tracking vehicle-associated orders.
2025-01-07 11:48:27 +01:00
Jepp9350 56c81f084d Add restriction methods for specific customer purchases
Introduced three new methods: `restrictSpotFree`, `restrictInteriorCleaning`, and `restrictTankCleaning`. These methods check if a customer is restricted from purchasing certain services based on their attributes. This enhances control over customer purchase eligibility.
2025-01-07 11:25:27 +01:00
Jepp9350 36537fcc1e Added support for E-conomic departments. 2025-01-06 13:36:16 +01:00
Jepp9350 16c1716cd0 Fixed formatting 2025-01-06 12:20:29 +01:00
Jepp9350 0ba926abb4 Added economic_department_id to departments. 2025-01-06 11:52:05 +01:00
Jepp9350 c4b57e7bac Added order item quantity parameters 2024-12-20 12:21:40 +01:00
Jepp9350 ab8a9ff39d Added order item quantity parameters 2024-12-20 12:21:09 +01:00
Jepp9350 e748b7af75 Cleaned up 2024-12-20 12:20:42 +01:00
Jepp9350 5d39c0943f Cleaned up, added formatting. 2024-12-20 10:27:18 +01:00
Jepp9350 f24fce594b Cleaned up, added formatting. 2024-12-20 10:26:01 +01:00
Jepp9350 ec6d03e29f Fixed an issue causing the attributes to sometimes be stored twice.
Added the invoicePerOrder function, a shortcut to see if a user has the 'invoiceAllOrdersIndividually' attribute.
2024-12-20 10:24:06 +01:00
Jepp9350 7929a1875a Fixed a bug when no authorization token was provided. 2024-12-19 12:44:45 +01:00
Jepp9350 0d577c5731 Added the /orders DELETE route. 2024-12-19 12:09:21 +01:00
Jepp9350 e9a3029628 Added filter removing deleted objects from paginated object lists 2024-12-19 12:08:33 +01:00
Jepp9350 a9565bfb29 Changed order of functions. 2024-12-19 10:55:21 +01:00
Jepp9350 f5a6ade96a Added the /user/bookings endpoint.
Made the bookings object find the id based on the name.
Added the booking user pagination.
2024-12-19 10:54:19 +01:00
Jepp9350 d1a804a4c0 Added cron.php
Made it automatically override the .htaccess, temporarily.
2024-12-19 09:18:50 +01:00
Jepp9350 8d4995eea3 Added the bookings route, and the bookings_o.php object. 2024-12-19 09:18:05 +01:00
Jepp9350 b237915194 Removed the requirement of providing all fields when changing orders (PUT). 2024-12-17 15:34:10 +01:00