Commit Graph
1711 Commits
Author SHA1 Message Date
Jepp9350 172e37d3a2 Add reCAPTCHA support and enhance Economic configurations
Introduce reCAPTCHA integration with validation and configuration handling. Update Economic module to include layout management and dynamic configuration via API. Added traits for managing module settings and encapsulated new endpoint routes for expanded functionality.
2025-02-10 15:27:32 +01:00
Jepp9350 ac657d6130 Add endpoint to close invoice drafts and refactor routes
Introduced a new POST endpoint `/invoices/draft/close` to allow closing of draft invoices, enforcing user authentication and permissions. Refactored and reorganized route and utility methods to improve readability and maintainability, including restoring `match_route` and restructuring `fromRequest`. Removed unused methods for cleaner code.
2025-02-07 13:03:22 +01:00
Jepp9350 f8cd736154 Add new endpoints and support for fetching user keys
Introduced functionality to fetch all user keys with associated data. Implemented new endpoints for deleting user bookings and retrieving user IDs, alongside permission checks and validation. Minor adjustments made for better error handling and improved debug logging behavior.
2025-02-07 10:33:41 +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 7186b27b74 Improve invoice fetching and add vehicle plate lookup API
Refactored the invoice retrieval to handle pagination for both drafts and booked invoices, ensuring all results are fetched when exceeding the limit. Added a new route for vehicle plate lookup, allowing retrieval of order history for a specified vehicle plate. Implemented the corresponding database query method in `orders_o`.
2025-02-05 16:18:52 +01:00
Jepp9350 6404ba65b2 Enhance invoice line formatting and content handling.
Standardize line formatting by prefixing notes and references with '#'. Refactor handling of registration numbers and discounts for improved clarity. Ensure empty lines are added for better visual separation in invoices.
2025-02-05 13:56:47 +01:00
Jepp9350 d022982b77 Add functionality for handling draft invoices in statistics
Introduced new endpoints and methods to incorporate draft invoice data into economic statistics. This includes calculating totals across various timeframes and aggregations by departments. Updated routes and traits to support these additions, ensuring seamless integration with the existing economic module.
2025-02-04 16:53:41 +01:00
Jepp9350 c82c201ff1 Add support for handling booked invoices and department stats
Introduced functionality for fetching and processing booked invoices with department-specific statistics. Added pagination and filtering capabilities for economic endpoints, including department data handling. Updated nginx configuration to support additional HTTP methods (PUT, DELETE).
2025-02-04 11:46:35 +01:00
Jepp9350 6ebea5504e Add endpoints and routes for economic statistics management
Implemented economic-related classes, endpoints, and routes to support fetching invoice totals, sent invoices, and department data. These changes enhance functionality by exposing APIs for economic statistics and integrating them into the statistics module.
2025-02-04 08:36:05 +01:00
Jepp9350 0960f35007 Add force_all parameter to getDepartmentById method
This update enhances the `getDepartmentById` method by adding an optional `force_all` parameter to bypass caching and fetch data directly from the database. Adjusted related calls in `orders_o` to use this new parameter where needed. This ensures greater control over data retrieval behavior.
2025-02-03 13:57:42 +01:00
Jepp9350 1e8c60e33a Refactor booking status handling and enhance file checks.
Updated booking logic to include completed bookings in cancellation handling. Added `isFileInStore` to improve file existence checks in the wash certificate store. Adjusted file server logic to use the new method for enhanced clarity and maintenance.
2025-02-03 09:34:09 +01:00
Jepp9350 bcbb4c0164 Add order statistics functionality
Introduced functionality to calculate and retrieve order statistics, including monthly counts per department. Updated statistics interface, routes, and supporting logic to handle new "orders" data type alongside bookings. Refactored code to streamline label generation by year and month ranges.
2025-01-31 16:17:34 +01:00
Jepp9350 e09eedb010 Add statistics feature with bookings tracking functionality
Introduce a scalable statistics architecture including `statistics` class, interface, and related implementations. Added support for tracking new bookings with routes and data handling through `bookings_s` and `statistic_t`. Integrated the feature into the application using autoloaders and response mechanisms.
2025-01-31 12:32:22 +01:00
Jeppe B 2b99414c18 Merge pull request #12 from copenhagentruckwash/development
development
2025-01-31 09:27:40 +01:00
Jepp9350 ca52d3b248 Update API endpoints, add wash certificate handling
Replaced legacy 'nnks.truckwash.dk' endpoint with 'api.truckwash.dk' across the codebase for consistency. Implemented a feature to handle certificate downloads, including file serving and validation. Updated PHP configuration to support additional dependencies like PHPMailer, and introduced necessary route and configuration changes for wash certificate processing.
2025-01-31 09:25:18 +01:00
Jepp9350 13fb3a10ae Simplify department name retrieval logic in Redis class
Replaced JSON decoding with direct object casting for department data, reducing unnecessary parsing overhead. This change ensures a more efficient and straightforward handling of the `get_department_name` function.
2025-01-30 16:59:33 +01:00
Jepp9350 2663c09455 Improve plate scanner handling and add pagination support
Refactored listObjects to include searchable fields and support for pagination. Enhanced validation logic for clearer error handling of required fields. Removed unused import to clean up the codebase.
2025-01-30 16:17:06 +01:00
Jepp9350 2e61eaa414 Add support for customizable searchable fields in queries
Introduced a `setSearchableFields` method to restrict searchable fields in database queries, enhancing security by preventing unintended access to sensitive data. Updated user and department routes to leverage this feature. Default behavior remains unchanged when no searchable fields are specified.
2025-01-30 15:29:21 +01:00
Jepp9350 562788e9ff Update backup service to use periodic execution with curl
The Dockerfile now uses a loop to run the backup script every 60 seconds. Added `curl` installation and a curl command in `backup.sh` for external script execution. Removed unused echo statements for clarity.
2025-01-29 17:20:39 +01:00
Jepp9350 d5e3991bf8 Add initial backup service with Docker and scripts
This commit introduces a Dockerized backup service, including a Dockerfile, a placeholder `backup.sh` script, and a functional `database_export.sh` script for creating database backups. The setup ensures required validations and dependencies for safely exporting database content. Further implementation is needed in `backup.sh`.
2025-01-29 16:51:19 +01:00
Jepp9350 3f9e6310f4 Remove unnecessary app directory copy in Nginx Dockerfile
The COPY command for transferring /app to /var/www/html was commented out as it is redundant. Nginx is not being used to serve static files in this setup with separate PHP and Nginx containers. This helps avoid unnecessary actions and aligns the configuration with the intended architecture.
2025-01-29 15:29:32 +01:00
Jepp9350 b97881ff05 Update database table references and clean up whitespace
Replaced all references to `maintenancemode_dbtest.customer_attributes` with `customer_attributes` in `users_o.php` for clarity and consistency. Additionally, removed unnecessary empty line in `redis_t.php` to improve code formatting.
2025-01-29 15:14:17 +01:00
Jepp9350 707df910b0 Refactor: migrate files 2025-01-29 14:27:44 +01:00
Jepp9350 4c74dd7995 Add booking synchronization and handling improvements
Introduce functionality to synchronize bookings, including creating or updating bookings based on provided details. Added strong typing to the `addOrUpdate` method for improved robustness and code clarity.
2025-01-28 15:57:10 +01:00
Jepp9350 4719d8f318 Remove redundant booking sync logic from bookingsRoute.php
The logic for syncing bookings, including data extraction and updates, was removed as it is no longer needed. This improves code readability and reduces unnecessary complexity in the route handling. The success response logic remains intact.
2025-01-28 15:48:26 +01:00
Jepp9350 b492f16e01 Add host details and refactor env handling
Added hostname and version information to the worker status response. Refactored environment variable handling for better readability and modularity. Updated .dockerignore to exclude `docker-compose.yml`.
2025-01-28 14:19:05 +01:00
Jepp9350 ee61474d65 Add docker-compose.yml to .gitignore
This update ensures that the docker-compose.yml file is excluded from version control. It prevents accidental commits of local development configurations.
2025-01-28 11:51:17 +01:00
Jepp9350 0987140e61 Add containerization and improve economic invoice handling
Introduce Docker support with a Dockerfile and example docker-compose setup, enlisting services like MySQL and Redis. Enhance economic invoice drafts with support for dimensions while restructuring related logic and schemas for better maintenance and clarity.
2025-01-28 11:50:12 +01:00
Jepp9350 f0747d1966 Normalize handling of pickup_bool in booking data.
Refactored `pickup_bool` parsing to ensure consistent boolean handling across the application. Replaced mixed type checks with explicit boolean conversion and updated relevant logic to improve data reliability. This change avoids potential errors caused by inconsistent input formats.
2025-01-28 08:44:34 +01:00
Jepp9350 37673f4aa6 Refactor order drafts endpoint to return comprehensive object
Updated the `get` method to return a detailed object with collection and pagination details, improving data structure consistency. Adjusted endpoint request to target `/orders/drafts` for the appropriate data. Minor test and dependency additions ensure proper functionality and integration.
2025-01-27 10:12:14 +01:00
Jepp9350 422d8fa18a Add Economic integration and support for wash completion
Introduce new classes, interfaces, and traits for integrating Economic API, including handling orders and drafts. Add CLI commands, test scripts, and database updates for enhanced functionality. Implement endpoint to complete a wash without a wash certificate.
2025-01-24 16:06:13 +01:00
Jepp9350 d3e9391160 Add new cron tasks and enhance user synchronization logic
Introduced cron tasks for syncing user economic customer details and discounts. Enhanced caching mechanisms for users and departments, added Slack messaging capabilities, and updated CLI/script routing for better flexibility. New routes and utility methods improve cron execution and logging.
2025-01-24 13:04:10 +01:00
Jepp9350 f450650db0 Refactor caching and customer data handling.
Replaced direct user object usage with Redis caching for customer information, optimizing retrieval logic and adding support for caching user IDs by customer number. Updated methods to allow dynamic object ID handling in caching operations and improved cache key consistency. These changes enhance performance and maintainability.
2025-01-23 17:03:41 +01:00
Jepp9350 bbc4eb07a8 Refactor cron tasks and user caching mechanisms
Introduced a more dynamic and modular cron task system for better task management. Reworked user-related caching to use a consistent structure, replacing economic-specific functions with general-purpose methods. Improved customer and booking synchronization processes to streamline operations.
2025-01-23 16:08:22 +01:00
Jepp9350 576d43bbfe Refactor return types and add password handling logic.
Updated return types from `language_pack_i` to `object` for flexibility. Enhanced `parseUsers` to convert empty passwords into booleans for better data representation. Added a new endpoint to list number plate scans with proper logging and session validation.
2025-01-23 13:14:41 +01:00
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
Jeppe B 8a4cf8fe1f Merge pull request #11 from copenhagentruckwash/development
Add cache clearing after token deletion
2025-01-22 17:48:52 +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
Jeppe B 61a6c450ba Merge pull request #10 from copenhagentruckwash/development
Add language pack support and improve token caching
2025-01-22 17:47:08 +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
Jeppe B e1fe69f898 Merge pull request #9 from copenhagentruckwash/development
Add improvements for bookings and notifications
2025-01-21 22:30:00 +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
Jeppe B cae0a3916b Merge pull request #8 from copenhagentruckwash/development
Add Redis caching, Slack notifications, and booking logic.
2025-01-17 08:40:27 +01:00