Commit Graph
58 Commits
Author SHA1 Message Date
Jeppe B d263045d71 Merge pull request #7 from copenhagentruckwash/development
Refactor wash certificate handling and Add Minio integration
2025-01-15 15:17:54 +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
Jeppe B 59230c8568 Merge pull request #6 from copenhagentruckwash/development
Refactor pagination and filtering logic
2025-01-13 15:52:28 +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
Jeppe B d77c65507a Merge pull request #5 from copenhagentruckwash/development
Add public employees route and user permission methods
2025-01-10 14:21:35 +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
Jeppe B 5ee77054ba Merge pull request #4 from copenhagentruckwash/development
Add functionality for managing custom user discounts
2025-01-08 15:49:25 +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
Jeppe B 79e8a6a8e6 Merge pull request #3
Handle open invoice drafts and improve order-fetching
2025-01-07 15:30:08 +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
Jeppe B 98d898b8c3 Merge pull request #2 from copenhagentruckwash/development
Add support for E-conomic departments and fix formatting issues
2025-01-06 15:43:51 +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
Jeppe B 0c1a1ddaea Merge pull request #1
Development
2024-12-20 12:27:56 +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
Jepp9350 20db2a2245 Added Reg. 1-3, if set to the invoice as default.
Added Reference to to invoice.
Added Price difference display on invoices.
2024-12-17 15:33:07 +01:00
Jepp9350 feb413d2e9 Added prefix to TEXT lines, to make it look more organized. 2024-12-17 15:31:40 +01:00
Jepp9350 8c0f3a1b5c added /order/items route, making it possible to change price, notes, references on order items. 2024-12-17 12:01:37 +01:00
Jepp9350 94e833da68 Added PATCH route method. 2024-12-17 12:01:01 +01:00
Jepp9350 9d74736b31 Made the invoice text lines actually text lines. 2024-12-17 12:00:43 +01:00