Commit Graph
46 Commits
Author SHA1 Message Date
Jeppe B 068f9e254f Complete selected-customer invoice period tree (#338)
Add the authoritative revision-bound invoice collection tree and guarded cleanup, merge, price-reset, and transfer operations.
2026-08-03 12:02:34 +02:00
Jeppe B c795df4aad Add invoice period review workflow (#336)
Improve the superuser invoice-period review API, stale-preview protection, queue visibility, review blockers, and e-conomic eligibility.
2026-08-02 19:20:50 +02:00
Jeppe B 2a6a86c9c3 Resolve backend Qodana critical and high findings (#314)
Resolve recommended-profile Critical and High findings, retain narrow analyzer exceptions, and update the edge-broker WebSocket dependency to a non-vulnerable release.
2026-07-17 05:44:16 +02:00
Jeppe B 879dfcf79a Improve invoice period data and POS add-on validation 2026-07-15 17:04:52 +02:00
Jeppe Bundgaard 172a21c517 Implement department-specific customer pricing functionality 2026-07-07 17:27:56 +02:00
Jeppe Bundgaard 248a901f24 Merge master into fixed price override branch 2026-07-06 16:54:01 +02:00
Jeppe Bundgaard f02dfd8c9c Add customer product fixed price overrides 2026-07-06 12:52:33 +02:00
Jeppe Bundgaard d47ea1d659 Add custom-only department pricing enforcement 2026-07-06 10:15:11 +02:00
Jeppe Bundgaard cd100f1180 Invalidate cached session payloads on notification preferences update; enhance flag tab filtering logic 2026-06-08 18:40:15 +02:00
Jeppe B 5be6bc0198 Guard invoice period flags by list permission 2026-06-01 23:24:50 +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 6c40810caf Add unit tests for invoicing period pagination, normalization, and filtering logic
- Implemented `InvoicingPeriodPaginationTest` for testing period pagination modes, normalization of options, search functionality, and visibility filters.
- Added comprehensive tests to validate scenarios such as active period views, exact counts, and customer-card level search.
- Improved cURL timeout settings with `CURLOPT_CONNECTTIMEOUT` and `CURLOPT_TIMEOUT` adjustments.
- Introduced and documented helper classes/methods for local caching, pagination response structure, and customer name retrieval.
2026-05-12 03:37:47 +02:00
Jeppe Bundgaard c1b66a81cc Add invoice_period_flag_ classes to manage invoice period flags with schema, services, and flag lifecycle methods
- Introduced `invoice_period_flag_schema_bootstrap` to initialize the schema for invoice period flags.
- Added `invoice_period_flag_service` to handle manual and automatic flag creation, updates, filtering, and context resolution.
- Implemented lifecycle methods such as `createManualFlag`, `updateAutomaticFlagStatus`, and `applyFlagsToPeriodTypes` for handling invoice period flags and their usage in processing periods.
- Included context-specific resolution methods for efficient flag management in invoicing workflows.
2026-05-11 21:34:57 +02:00
Jeppe Bundgaard 6d4066be1c Add unit tests for InvoicingPeriodDraftOverlay and reference suggestion logic, including fake DB integration and aggregation methods
- Implemented `InvoicingPeriodDraftOverlayTest` with coverage for blocking and permitting invoicing actions based on draft states, transactions, and metadata.
- Created `ReferenceSuggestionsApiTest` to validate ranked and filtered suggestions across bookings, orders, and vehicles with varied match relevance, context, and frequency.
- Added `order_reference_suggestions_service` class, including query methods, normalization utilities, and aggregation logic for reference suggestions.
- Enhanced query handling in `InvoicingPeriodDraftOverlayFakeDb` to validate SQL constraints and column cache resets in overlapping invoicing contexts.
2026-05-11 18:18:08 +02:00
Jeppe Bundgaard 22f856c62a Add unit tests for invoicing, orders normalization, gateway commands, and department complaints. Update schema bootstraps and improve agent command execution logic. 2026-04-09 12:24:22 +02:00
Jeppe Bundgaard 653680376a Add unit and integration tests for collected invoice queue handling, route hardening, lifecycle validation, and manual batch processing logic. 2026-04-08 15:53:22 +02:00
Jeppe Bundgaard 6aa04eb951 Add logic for booked department 75 redistribution with fixed pricing and subscription weights. Update OpenAPI spec, unit tests, and service integration. 2026-03-16 13:40:03 +01:00
Jeppe Bundgaard f651309d6a Add caching for Economic V2 distribution responses and optimize service methods with localized in-memory caches 2026-03-12 19:32:57 +01:00
Jeppe Bundgaard 4ef20a1c90 Add economic V2 modules for history backfill, comparison, and distribution services. 2026-03-12 17:57:27 +01:00
Jeppe Bundgaard 4523115584 Introduce centralized date normalization and duplicate filtering for invoicing logic, and add comprehensive unit tests 2026-03-12 16:09:54 +01:00
Jeppe Bundgaard 2ca29a77f1 Optimize order and transaction processing logic with caching, and implement opt-in Slack summaries to reduce request latency. 2026-03-12 16:00:57 +01:00
Jeppe Bundgaard 07dab83e36 Add caching for department metadata and invoicing exclusion checks, optimize department resolution logic in invoicing route 2026-03-12 14:40:47 +01:00
Jeppe Bundgaard e7ff44bf50 Return vehicle subscriptions array 2026-03-12 12:19:59 +01:00
Jeppe Bundgaard ddc45bf206 Update getCustomersWithVehicleSubscriptions to exclude fixed pricing customers and remove unused return statement in invoicing route 2026-03-12 12:17:52 +01:00
Jeppe Bundgaard 15a7a7b8a5 Add weekly department results route, enhance date handling in invoicing and statistics logic, and improve Slack notification configuration 2026-03-11 10:52:49 +01:00
Jeppe Bundgaard 4945abfd8e Add new route for superuser invoicing period distribution and enhance date handling logic 2026-03-10 11:01:11 +01:00
Jeppe Bundgaard fc9d7882ae Refactor user retrieval logic to improve existence check for customer numbers 2026-02-26 22:51:37 +01:00
Jeppe Bundgaard 7aa397acda Add historical invoicing endpoint and enhance permission checks
- Introduce `/superuser/invoicing/period/distribution/wash-subscriptions/historical` endpoint to retrieve historical subscription orders with detailed processing, filtering, and summary calculations.
- Reinstate permission checks for invoicing period distribution endpoints.
- Add Slack notifications for subscription price distribution summaries.
- Refine department ID handling by excluding automatic department (ID 10) during processing.
2026-02-03 09:24:58 +01:00
Jeppe Bundgaard 08077df618 Add getOrderItemObjects and getProduct methods, and enhance Slack notifications in invoicing routes
- Introduce `getOrderItemObjects` in `orders_o` to retrieve item objects for an order.
- Add `getProduct` in `order_items_o` for product retrieval by item.
- Enhance Slack notification logic in invoicing routes for better error reporting and fixed pricing summaries.
- Temporarily comment out permission checks in certain invoicing endpoints for debugging purposes.
2026-02-02 12:57:27 +01:00
Jeppe Bundgaard 14aaf68d69 Skip transactions with automatic department ID during invoicing processing. 2026-01-06 10:56:39 +01:00
Jeppe Bundgaard d2f82b83ed Validate subscription price distribution and skip excluded transactions in invoicing
- Enforce validation to ensure department distribution matches total subscription price.
- Skip transactions not included in invoicing for improved accuracy.
- Uncomment permission checks in specific routes.
2025-12-01 13:19:59 +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 3dba2dedac Add isIncludedInInvoicing method and implement invoicing exclusions
- Introduced `isIncludedInInvoicing` in `orders_o` to check department-based invoicing exclusions.
- Updated routes and methods to skip orders excluded from invoicing.
- Refined transaction and order handling to respect invoicing settings, ensuring correct filtering.
2025-11-25 14:39:49 +01:00
Jeppe Bundgaard fbbcf7e85d Add collective subscription price aggregation and department distribution parsing
- Enhanced `getTransactionsWithItemsNotIncludedInInvoices` to aggregate total subscription prices and calculate department-based distribution.
- Added processing to parse department IDs into human-readable names.
- Updated response to include aggregated subscription results under `collective_subscription_results`.
2025-10-01 19:13:18 +02:00
Jeppe Bundgaard ed8a6454a6 Introduce subscription fallback mechanisms for vehicles with no transactions
- Added `attemptSubscriptionFallbacks` method in `InvoicingPeriodRoute` to handle vehicle subscription fallbacks through department-based strategies.
- Enhanced `customer_vehicles_o` with `getLastTransactions` for retrieving recent transactions.
- Updated `users_o` to support nullable return type for `getDefaultDepartment`.
2025-10-01 15:30:56 +02:00
Jeppe Bundgaard 86acc3a183 Add invoicing distribution endpoints and subscription processing features
- Introduced new endpoints for invoicing distribution: `/superuser/invoicing/period/distribution/fixed-pricing` and `/superuser/invoicing/period/distribution/wash-subscriptions`.
- Enhanced `customer_vehicles_o` with `getSubscriptionAppliedTransactionsFromList` method for transaction filtering based on subscriptions.
- Added `getNetAmountForOrderItemsOriginal` to `orders_o` for calculating the original net amount of order items.
- Introduced parsing utilities for department-based aggregation in invoicing.
- Extended `products_o` with `getSubscriptionMonthlyPrice` to calculate subscription pricing.
- Added `getFieldsWhereIn` to `db_object_t` for advanced database querying.
2025-10-01 10:21:58 +02:00
Jepp9350 7a8edd0f28 Enhance orders_o and InvoicingPeriodRoute: expand duplicate detection logic by including additional registration fields, refine duplicate filtering criteria, and update transaction handling flag for possible duplicates. Add new xlvask_parser_ikke_ht_dysebom_mellom_bil_trailer parser and integrate it into xlvask_helpers. 2025-07-06 13:38:34 +02:00
Jepp9350 3d8700bad6 Refactor InvoicingPeriodRoute: add meta parameter for transactions, enhance fixed pricing retrieval, and implement utility method for array-based object matching. 2025-07-03 09:59:12 +02:00
Jepp9350 c429c359ea Refactor getOrdersWithPossibleDuplicates and InvoicingPeriodRoute: simplify duplicate order detection, enhance customer transaction handling, and streamline object construction for improved efficiency. 2025-07-01 13:51:31 +02:00
Jepp9350 f503a5379e Enhance orders_o, order_items_o, and InvoicingPeriodRoute: add transaction and calculation methods, implement debug execution timing, refine invoicing period handling, optimize order retrieval, improve caching, and expand database query logic. 2025-07-01 13:01:01 +02:00
Jepp9350 e583a269d0 Add getOrdersWithPossibleDuplicates method in orders_o and getPossibleDuplicates method in InvoicingPeriodRoute to identify and handle potential duplicate orders within a specified date range. 2025-06-30 17:39:11 +02:00
Jepp9350 6b80637208 Refactor InvoicingPeriodRoute and vehiclesRoute: streamline invoicing period data retrieval, enhance transaction handling across customer types, introduce new methods for efficient object construction, and add improved type validation in object_property. 2025-06-30 14:37:37 +02:00
Jepp9350 e0f582289f Refactor orders_o, InvoicingPeriodRoute, and object_property: enhance ID validation, streamline customer processing, and improve method structures for better data handling. 2025-06-26 16:55:37 +02:00
Jepp9350 c5a6b2006f Add methods for retrieving customers and transactions within date ranges, enhance orders_o functionality, and improve customer object construction in invoicing routes. 2025-06-26 16:06:02 +02:00
Jepp9350 9774b589cc Add handling for fixed pricing and tank cleaning transactions with action checks and enhanced customer retrieval 2025-06-02 22:04:57 +02:00
Jepp9350 27ca81ba8f Add support for invoicing period retrieval and enhanced filtering options for wash subscription transactions 2025-06-02 14:08:57 +02:00