Commit Graph
17 Commits
Author SHA1 Message Date
Jeppe B bd7deaeded Fix invoice period flag cache fallbacks 2026-06-01 23:29:05 +02:00
Jeppe Bundgaard 0399cb4bb4 Implement economic config round-trip test and enhance department handling
- Added a test to ensure correct round-tripping of default distribution department config value through economic config updates.
- Improved department handling by adding fallback logic to use the default economic distribution department id when a customer's department id is missing.
- Enhanced weather API routes to fetch, cache, and return detailed employee contributions per department for a given time slot.
2026-05-13 17:37:49 +02:00
Jeppe Bundgaard 5965c5d72d Implement invoice period warming queue handling with Redis interface
- Added methods `enqueueInvoicePeriodWarming` and `consumeInvoicePeriodWarmingQueue` to the `Redis` interface for managing warming periods.
- Modified `invoice_period_flag_service` to enqueue warming periods on cache misses.
- Updated cron job logic to process invoice period warming queues and ensure flags are warmed effectively.
2026-05-12 16:01:55 +02:00
Jeppe Bundgaard d9813a3fe2 Add caching methods for invoice period flags and cron jobs for warming caches
- Introduced methods for caching, retrieving, and clearing manual and automatic invoice period flags, as well as order item rows, using the Redis interface.
- Implemented `warmManualFlagsCache` and `warmAutomaticFlagsForPeriod` methods in `invoice_period_flag_service` to enhance performance by loading flags and order items into cache.
- Added new cron jobs `WarmInvoicePeriodManualFlagsCron` and `WarmInvoicePeriodAutomaticFlagsCron` to regularly update cached data for improved access speeds.
2026-05-12 14:04:51 +02:00
Jeppe Bundgaard bea7e5697b Handle empty inputs in Redis and database operations, improve safety seal validation, and enhance related tests
- Return empty arrays for empty inputs in Redis `mget`, `db_object_t`, and `users_o` operations.
- Refactor safety seal validation logic to handle numeric strings and improve clarity.
- Add unit and API tests to verify handling of empty inputs and numeric safety seal strings.
2026-05-11 04:36:11 +02:00
Jeppe Bundgaard de89c4d635 Add database and Redis port configuration support, connection health checks, and refactor worker status endpoint. 2026-03-20 13:01:21 +01:00
Jeppe Bundgaard 979b0f8fac Add atomic reservation support in Redis for goal alert deduplication with expiration. Update Cron logic and add unit tests for validation. 2026-03-17 15:23:02 +01:00
Jeppe Bundgaard 5cc311ae32 Add Redis-based permission caching for users and subusers
- Introduced Redis-backed caching for user and subuser permission evaluations in the `route_t` trait, reducing database queries.
- Enhanced `Redis` class with methods for permission caching: `cache_permission`, `get_permission`, and `clear_permission`.
- Added test coverage for the new caching logic in `PermissionRedisCacheTest.php`.
- Implemented Redis caching for authentication sessions with `cache_auth_session`, `get_auth_session`, and `clear_auth_session`.
- Improved CORS handling for preflight requests in `index.php`.
2026-02-24 15:00:22 +01:00
Jeppe Bundgaard 79d0b2f270 Add Redis caching methods for customer-user mappings
- Introduced methods `cache_customer_number_from_user_id`, `get_customer_number_from_user_id`, and `clear_customer_number_from_user_id` to the `Redis` class.
- Updated the `Redis_i` interface to define these new methods.
- Enhances customer-user mapping logic by integrating Redis for efficient caching and retrieval.
2026-02-24 12:44:57 +01:00
Jeppe Bundgaard 88d3e20de6 Expire department webhook in Redis and refactor Slack notification logic
- Add 5-minute expiration for cached department webhooks in `redis.php`.
- Cast department ID to integer in `departments_o.php`.
- Refactor Slack notification logic to use `send_webhook_message` for custom department webhooks.
- Update `send_webhook_message` visibility from protected to public in `slack.php`.
2026-01-26 13:09:21 +01:00
Jeppe Bundgaard e0e479a15d Introduce method-level caching for department reports to enhance performance
- Wrap report calculation logic in `methodCacheWithParameters` for 2-minute caching.
- Standardize reusable caching logic in `db_object_t` trait.
- Refactor query-based methods to integrate caching and improve maintainability.
2026-01-22 12:18:39 +01:00
Jeppe Bundgaard ecd44a455a - Add Redis mget method and cache management improvements
- Update cache expiration times for `economicCustomerName` and `isBooked` objects
- Introduce `getCachedForMultipleObjects` for batch cache retrieval
- Optimize `isBooked` with optional caching and update to store results
- Implement `getCustomerNames` in `users_o` with caching for bulk name retrieval
- Refactor customer transaction handling in `InvoicingPeriodRoute` for efficiency
- Filter orders excluded from invoicing in `collected_order_invoices_o`
2025-11-26 10:01:24 +01:00
Jeppe Bundgaard af3b0666fb Add import tasks and new parsers to XL Vask module
- Introduced `runImportTasks` method for vehicle, user, and usage log imports.
- Added new product parsers: `ht_b_rstel_s`, `ht_turbo`, and `ikke_b_rster_p_kabinen`.
- Implemented simulation and duplicate detection for usage logs via order objects.
- Updated usage log handling to include default customer checks and user association.
- Enhanced request handling with fast-link functionality for usage orders.
2025-07-21 10:32:56 +02:00
Jepp9350 ff4c18a45d Add key expiration support in Redis class with expire method implementation 2025-06-03 10:16:58 +02: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 707df910b0 Refactor: migrate files 2025-01-29 14:27:44 +01:00