Commit Graph
1696 Commits
Author SHA1 Message Date
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
Jepp9350 3bf79997f3 Added the /superuser/user route, used to get all user-related data. 2024-12-17 08:07:21 +01:00
Jepp9350 fae72cce75 Added the customer codes, and abstract variable storage for user objects. 2024-12-16 14:43:21 +01:00
Jepp9350 03515a83d6 Added the display_name parameter 2024-12-16 11:03:18 +01:00
Jepp9350 c9db9e7f09 Added the group_id parameter 2024-12-16 10:20:16 +01:00
Jepp9350 9d694d27ce Added .editorconfig to maintain consistent coding style 2024-12-16 09:01:06 +01:00
Jepp9350 6a81ae26c4 Added config.php to .gitignore 2024-12-16 09:00:38 +01:00
Jepp9350 914f5ba1b0 Added the files from MVP 2024-12-16 08:54:03 +01:00
Jepp9350 b831ad9332 Added the .htaccess
This makes sure that any paths is being resolved by the index.php file.
2024-12-16 08:53:16 +01:00