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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.