Commit Graph
1711 Commits
Author SHA1 Message Date
Jepp9350 4d593c2b17 Add department daily reports feature and improve product handling
Introduced functionality for managing department daily reports, including endpoints for creating, updating, listing, and viewing product sales data. Enhanced product handling in reports by adding support for water usage, notes, and detailed product sales metrics. These changes improve tracking and reporting accuracy across departments.
2025-03-04 11:39:38 +01:00
Jepp9350 9d005566cc Refactor permissions and add department daily reports feature
Updated customer search route permission for clarity and introduced new functionality to manage and retrieve department daily reports. Added `department_daily_reports_o` object and associated route for handling reports, including permission checks, logging, and support for pagination.
2025-03-04 08:32:49 +01:00
Jepp9350 8928cd375a Add booked_invoice_id property and optimize invoice handling
Introduce the booked_invoice_id property in collected_order_invoices_o for improved invoice management. Optimize performance by avoiding redundant requests to external systems when the booked_invoice_id is already set. Enhance routes to include the booked_invoice_id in relevant responses and ensure a consistent structure for associated data.
2025-03-04 08:24:33 +01:00
Jepp9350 bad6a62a5a Add closed_at field to order serialization
The `closed_at` field is now included when serializing order data. This provides additional context regarding the closure state of invoices in the order, enhancing data accessibility and utility.
2025-03-03 17:24:12 +01:00
Jepp9350 9e46140373 Add support for handling economic invoice drafts/booked IDs
Added methods to check and retrieve economic invoice draft and booked IDs, improving invoice tracking functionality. Introduced a new method in the economic endpoint to fetch booked invoice details using external IDs. Additionally, updated the object property class to handle integer values during SQL updates.
2025-03-03 16:55:09 +01:00
Jepp9350 68b3fd2171 Add customer detail accessors and update usage in endpoints
Added individual getter methods for customer details such as name, email, address, zip code, city, and country in the economic_customer module. Updated the invoices drafts endpoint to use these accessors instead of directly accessing properties. Included an exception throw for failed requests in the endpoint.
2025-03-03 16:00:23 +01:00
Jepp9350 2042f0c00a Add capability to sync collected invoices to E-Conomic
Introduced a new endpoint for syncing collected order invoices with E-Conomic via a POST route. Added methods for creating, managing, and closing invoice drafts in E-Conomic. The implementation includes validations, external ID handling, and seamless integration of payment terms and layout configurations.
2025-03-03 15:36:58 +01:00
Jepp9350 dc419e1715 Remove unused MotorAPI license plate lookup endpoint
The `/modules/motorapi/lookup` route has been removed as it is no longer needed. This cleanup reduces codebase clutter and eliminates outdated or redundant functionality.
2025-03-03 12:18:36 +01:00
Jepp9350 b66c598f83 Add external ID generation and update user route actions
Introduce methods to generate and retrieve unique external IDs for collected order invoices, ensuring UUID-based uniqueness. Update user route actions to include new functionalities for editing user roles and passwords.
2025-03-03 10:58:55 +01:00
Jepp9350 e9aeedc327 Add invoice collection assignment logic to orders and users
Introduced methods to manage, assign, and retrieve invoice collections for orders and users. Enhanced the system to support flexible invoice grouping, including per-order logic and automated assignment to open or newly created invoice collections.
2025-02-28 13:50:27 +01:00
Jepp9350 9bf0355e47 Add routes and objects for managing collected order invoices
Introduced GET and POST endpoints for collected order invoices, enabling listing and creation functionalities for authorized users. Added a new database object to handle invoice-related operations and validations. Included utility functions to enforce parameter requirements and data integrity.
2025-02-28 12:07:46 +01:00
Jepp9350 7497e0c744 Fix undefined filter check in db_object_t trait logic
Ensure the filter is set before validating its value against allowed options. This prevents potential undefined index errors when filters are not provided.
2025-02-28 11:04:22 +01:00
Jepp9350 72df11e345 Simplify permission handling in group addition.
Removed unnecessary array key access for permissions in the loop. This improves code readability and ensures the permission object is directly passed without intermediate referencing.
2025-02-28 09:30:25 +01:00
Jepp9350 2fca599599 Add role cloning functionality and adjust permission methods.
Introduced a method to clone groups with their permissions and added a corresponding API endpoint for role cloning. Adjusted existing permission methods to ensure consistent behavior and naming, swapping the implementation of add/remove permissions. Improved permission fetching logic for cleaner data handling.
2025-02-28 09:27:06 +01:00
Jepp9350 491f268108 Add role and permission management with enhanced access control
This update introduces functionalities for managing roles, permissions, and access control across departments. Key additions include methods for filtering, restricting, and handling user permissions, as well as new APIs for assigning/removing permissions to/from roles. Access to resources like orders, bookings, and plate scans is now securely tied to department-specific permissions.
2025-02-27 17:54:18 +01:00
Jepp9350 d430f6ff7f Add support for related item ID in order items
Enhanced the order items functionality to include a related item ID. This involved adding a new property, updating methods to handle the related item ID, and ensuring appropriate validation and sanitation in the API routes. Also improved input sanitization for motorapi lookups to prevent SQL injection risks.
2025-02-25 18:06:57 +01:00
Jepp9350 8b4187295c Handle token retrieval from JSON body in authentication.
Added support for extracting the token from JSON-formatted request bodies (`php://input`). This ensures compatibility with clients sending tokens in the request payload alongside other existing methods.
2025-02-24 11:59:35 +01:00
Jepp9350 b6a345edb2 Handle token authentication using POST parameters.
Previously, only tokens from headers or GET parameters were accepted. This update adds support for tokens sent via POST parameters, ensuring compatibility with more request types and improving flexibility for clients.
2025-02-24 11:18:03 +01:00
Jepp9350 da9ebbc160 Add vehicle type support and recommended order logic
Introduced vehicle type handling in `motorapi` with a helper class. Integrated recommended order logic based on vehicle plate and order history, enhancing order and department route functionality.
2025-02-21 17:28:48 +01:00
Jepp9350 d2c1cdda9a Add Stripe terminal and department variables API endpoints
This update introduces new endpoints for managing Stripe terminal readers, locations, and department-specific configurations. It also adds support for creating, updating, and retrieving department variables along with enhanced validation, logging, and permission checks. These updates improve integration and expand functionality for Stripe and department-related operations.
2025-02-21 14:43:33 +01:00
Jepp9350 ff12fbcbd0 Add Stripe endpoint for listing terminal readers
Introduced a new `stripe_endpoint_readers` class to handle terminal readers, with a `list` method to retrieve all reader data. Integrated this endpoint into Stripe module routes and updated dependencies to support terminal-related
2025-02-21 09:42:53 +01:00
Jepp9350 9e8f3f7088 Add corporateIdentificationNumber to filterable properties
This update enhances the filtering capabilities by including 'corporateIdentificationNumber' in the list of supported properties for search. It improves the flexibility of customer queries and ensures better alignment with user needs.
2025-02-21 09:42:42 +01:00
Jepp9350 2aa0854d3a Update sync interval for economic discounts to 1 minute
Changed the execution interval of `SyncUserEconomicCustomerDiscounts` from 10 minutes to 1 minute. This ensures more frequent updates and improves data synchronization accuracy.
2025-02-21 08:39:13 +01:00
Jepp9350 adc44eee9b Update description for 'get_user_id' route
Clarified the purpose of the 'get_user_id' route by specifying that it retrieves the user ID from the e-conomic customer number. This improves code readability and developer understanding.
2025-02-21 08:39:02 +01:00
Jepp9350 c95daeb619 Remove permissions from worker status API response.
The 'permissions' field has been omitted from the worker status API response payload. This ensures a more streamlined response and avoids exposing unnecessary data. The change does not affect the functionality of the API.
2025-02-20 17:13:59 +01:00
Jepp9350 9ce0dcd35c Add backup functionality to cron scheduler
Introduced a new "backup" task that runs every 12 hours. The task uses the backup_store class to create backups and handles exceptions gracefully by logging errors. This ensures regular backups and improves system reliability.
2025-02-20 17:11:57 +01:00
Jepp9350 367dfc44e4 Add role and permission management functionality
Introduce classes `groups_o` and `groups_permissions_o` for managing roles and permissions. Add new routes `rolesRoute` and `permissionsRoute` to handle role and permission-related operations. Enhance `users_o` with the `getGroup` method and update `db_object_t` for improved table handling and pagination support.
2025-02-20 17:04:35 +01:00
Jepp9350 d28cb172a0 Add permission definitions to route handlers
This update introduces explicit permission definitions for various route handlers across multiple routes. These changes enhance clarity and allow for more granular control over route access based on defined permissions. The updates ensure better manageability and scalability of endpoint permissions.
2025-02-20 14:33:42 +01:00
Jepp9350 d9638406d3 Implement route-level permission handling.
Added support for defining and registering permissions for API routes. Updated methods across the router and route traits to accommodate permission details, enabling better access control. Enhanced department license plate lookup with session validation and additional endpoints.
2025-02-20 14:12:21 +01:00
Jepp9350 b659b07d4c Add caching support for license plate lookups in MotorAPI
Introduced caching functionality to improve efficiency and reduce redundant API calls for license plate lookups. Added methods to check and retrieve cached entries while ensuring proper validation. Enhanced error handling for invalid responses and updated related routes and interfaces accordingly.
2025-02-20 10:59:09 +01:00
Jepp9350 9536b67998 Refactor unfulfilled bookings notification logic
Introduce a function to aggregate unfulfilled bookings by department. Replace individual Slack notifications with a single summary per department, improving efficiency and reducing redundant calls.
2025-02-19 17:54:53 +01:00
Jepp9350 53b61654bf Add Stripe invoice generation and customer management
Introduced functionality for creating and managing invoices using Stripe APIs, replacing the previous payment link system. Added customer account creation and retrieval, invoice line-item handling, and extended database object structures to support invoices. Updated order routing to include Stripe customer and invoice details.
2025-02-19 17:25:19 +01:00
Jepp9350 ea6c675826 Add support for Stripe economic customer number.
Introduced a new configuration variable `stripe_economic_customer_number_c` to handle the Economic customer number for invoicing. Updated the Stripe module to include this variable in initialization and allow updates. This enhancement enables better integration with invoicing workflows.
2025-02-19 14:16:17 +01:00
Jepp9350 afe0e1e3d6 Add MailerSend email service integration and templates
Introduced MailerSend as an email provider with essential configuration options, including API key management and "reply-to" support. Enhanced email functionality by implementing a modular template system (header, footer, and content) for both text and HTML formats. Updated the existing email infrastructure to handle Stripe invoice notifications via MailerSend with conditional fallback planned for default SMTP services.
2025-02-19 14:12:55 +01:00
Jepp9350 98879bf5b6 Update dependencies in composer.lock
Added new library dependencies, including `beberlei/assert`, `illuminate/collections`, `mailersend/mailersend`, and others, to `composer.lock`. These updates ensure compatibility and improve functionality by integrating the latest versions of required packages.
2025-02-19 12:00:16 +01:00
Jepp9350 143b024f78 Introduce Economic customer helper class and customer route
Added a helper class `economic_customer` to standardize customer data handling within the Economic API. Introduced a new route, `/modules/economic/customer`, for retrieving customers using their customer number. Updated `economic` class to integrate the helper and support streamlined customer operations.
2025-02-19 11:58:58 +01:00
Jeppe B 4bb7accc2a Merge pull request #13 from copenhagentruckwash/development
Add Stripe integration with enhancements and documentation
2025-02-19 09:27:23 +01:00
Jepp9350 156f036d4c Add reference to Stripe API documentation in stripe.php
Include a docblock with a link to the Stripe API customer creation docs. This provides developers with quick access to relevant documentation, improving code clarity and usability.
2025-02-19 09:24:34 +01:00
Jepp9350 410ca84bf1 Add Stripe integration for customers, payments, and products
This commit introduces a comprehensive Stripe module with support for managing customers, products, prices, and payment links. It also includes endpoint routes, helpers, and database updates to support Stripe operations, such as creating and retrieving entities or handling payment workflows. Additionally, a stripe module was integrated into existing routes and objects to enable seamless interaction with Stripe APIs.
2025-02-18 18:31:23 +01:00
Jepp9350 20841858ac Add Stripe PHP library to composer dependencies
Included `stripe/stripe-php` library (v16.5.1) in the project for handling Stripe API interactions. Updated both `composer.json` and `composer.lock` to reflect the new dependency.
2025-02-18 13:07:14 +01:00
Jepp9350 8702b41777 Add MotorAPI integration and Economic products support
Implemented MotorAPI lookup functionality with proper validation and logging. Added Economic products endpoint for fetching product details. Enhanced route parameter validation with length constraints and improved response handling for objects.
2025-02-18 12:34:26 +01:00
Jepp9350 5af6fc5aa5 Add MotorAPI module with configuration management
Introduced the MotorAPI module, including its configuration classes, interface, and integration with the router. The configuration supports enabling, managing API tokens, and daily request limits. Added support for fetching and updating MotorAPI settings via new API routes.
2025-02-18 09:03:06 +01:00
Jepp9350 9272342c3a Fix undefined discountPercentage by providing default value
Previously, the absence of a discountPercentage caused issues. The code now uses a default value of 0 to ensure stability and prevent potential errors when the discount is not set.
2025-02-17 13:12:57 +01:00
Jepp9350 67e6bb8bf2 Add product options and department categories API
Introduce endpoints for managing product options and department categories, including listing, creating, editing, and deleting functionalities. Updated related objects and traits to support new operations, including added array serialization methods and improved query handling for better flexibility.
2025-02-17 11:38:00 +01:00
Jepp9350 2151cf2b7b Add customer listing and import functionality for Economic
Implemented endpoints to list and import customers from the Economic API, including query filtering, pagination, and validation. Added supporting trait methods, database functions, and error handling. Expanded the user object for Economic integration and introduced utilities for type checking and parameter extraction.
2025-02-13 12:50:35 +01:00
Jepp9350 7525a89154 Refactor database operations and enhance routes for consistency
Refactored database methods to improve code readability, reusability, and error handling. Introduced input validation helper functions and parsing capabilities for objects with optional callbacks. Added new routes for handling categories and improved product-related functionality to align with the new architecture.
2025-02-12 16:39:52 +01:00
Jepp9350 c240bbd94f Refactor database object trait and improve data handling
Added `delete`, `restore`, and other utility methods to enhance CRUD operations, including support for soft deletes. Introduced `objectChanged` hooks across objects for better cache or event handling, ensuring scalability and maintainability. Refactored and standardized object property handling while restructuring related methods.
2025-02-12 09:23:35 +01:00
Jepp9350 555d4e9918 Add comprehensive backup functionality and refactor email handling
Implemented server, database, and environment backups with configurable modules. Introduced new routes and configuration classes for backups alongside improved zip and S3 storage. Replaced PHPMailer with a cURL-based email service for streamlined message sending.
2025-02-11 17:41:57 +01:00
Jepp9350 797630d8bd Add backup and email enhancements with PHPMailer integration
Introduced a backup system managing database and metadata files using Minio/S3, alongside routes for handling these. Integrated PHPMailer for robust email functionalities, including configuration testing and SMTP handling. Updated Dockerfile, composer dependencies, and minor code improvements to support new features.
2025-02-11 14:25:26 +01:00
Jepp9350 61de9cdb45 Add email configuration module and enable invoice PDF retrieval
Introduce an email configuration module to manage SMTP settings, including encryption, host, username, and more. Implement functionality for retrieving invoice PDFs, storing them, and providing secure download links. Added relevant endpoint, routes, and helper methods to support these features.
2025-02-10 18:07:51 +01:00