Commit Graph
23 Commits
Author SHA1 Message Date
Jeppe B ab6c3ba5b6 Fix route permission instance calls (#344)
## Root cause

`route_t::hasPermission()` and `requirePermission()` are instance
methods. Route code was invoking them with `self::`; the new XL Vask
hall-scope helper made that call from a genuinely static context,
causing PHP to throw:

`Non-static method routes\\xlvaskUsageLogsRoute::hasPermission() cannot
be called statically`

## Changes

- Invoke route permission methods through `$this` across all 273
executable legacy calls in 45 route classes.
- Make `xlvaskUsageLogsRoute::allowedHallIdsForUser()` an instance
helper and update all 13 callers.
- Preserve the existing all-scope and own-scope hall selection rules.
- Add a token-aware regression test that rejects executable
`self::hasPermission()` and `self::requirePermission()` calls, while
ignoring comments.
- Add focused XL Vask tests for global scanner hall scope and
group-limited own scope.
- Update affected route contract assertions to the instance-call form.

## Verification

- PHP lint: all 53 changed PHP files
- Focused PHPStan: changed XL Vask route and both new regression tests —
clean
- Focused regression slice: 58 passed, 748 assertions
- Full local unit suite: 1,300 passed, 9,442 assertions (1 unrelated
existing warning, 1 environment skip)
- Full local API suite: 285 passed, 11,704 assertions
- Exact-SHA GitHub Tests workflow: all 7 jobs passed (unit, API,
integration, legacy, edge gateway, and supporting checks)
- Independent exact-SHA QA gate: PASS, no findings
- Independent exact-SHA security gate: PASS, no findings
- Independent exact-SHA reviewer gate: PASS, no findings
- Remote comparison: exactly one commit ahead of
`40b104abed7723a7d1b7028190ecda0e7aeef829`; all 53 remote blob hashes
matched the reviewed worktree

## Delivery state

Draft only for human review. No merge or deployment is included. Qodana
is skipped while the PR remains draft and is therefore not represented
as a passed gate.
2026-08-04 16:04:41 +02:00
Jeppe B 1e0e051775 Harden Sæby demo registration and department scope (#335)
Complete and secure public customer/driver registration, authoritative limited-backoffice department scope, one-time employee QR login, and pricing concurrency for the Sæby demo.
2026-08-02 11:50:56 +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 Bundgaard c10af48954 Add daily report product target API 2026-07-06 18:52:24 +02:00
Jeppe Bundgaard eca7a81f9d Add superuser department overview API 2026-07-06 13:59:40 +02:00
Jeppe B ccffad3c7c Fix complaint department authorization 2026-06-01 23:53:36 +02:00
Jeppe Bundgaard 7d450e285e Remove outdated edge gateway object classes, add new agent implementation
Transitioned from obsolete gateway object classes (`edge_gateway_shell_action_jobs_o`, `edge_gateway_shell_events_o`, `edge_gateway_shell_sessions_o`, `edge_gateway_update_jobs_o`) to the new agent implementation (`edge-gateway-agent/agent.php`).
2026-04-21 14:13:17 +02:00
Jeppe Bundgaard 745e68aa4f Add wash_date and category fields to complaints, update schema and OpenAPI spec, and extend unit and integration tests for validation and route handling. 2026-04-09 14:16:35 +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 9e9372db05 Add unit tests for Bird department gate phone call logic, Edge Broker configuration, and gateway heartbeat status. Refactor warnings handling, Slack notifications, Bird client usage, and Edge gateway probes for improved maintainability and error clarity. 2026-04-09 08:53:10 +02:00
Jeppe Bundgaard 45b7250480 Add Edge Agent implementation for gateway connection lifecycle, agent commands, Shelly device discovery, relay control, and WebSocket communication with broker. Include unit tests for critical flows. 2026-04-08 19:01:42 +02:00
Jeppe Bundgaard d58fa69560 Refactor addon sales calculation logic and improve date handling in reports
- Standardize date formatting to cover full days in queries (`00:00:00` to `23:59:59`).
- Replace direct SQL queries with reusable department methods for calculating total addons and max addons.
- Update Slack notifications to include percentage breakdown with sold/total for each department.
- Remove redundant code and improve error handling for department data retrieval.
2026-01-22 10:19:06 +01:00
Jeppe Bundgaard 9ee4cf5ac8 Add water usage calculation to department daily reports
- Introduced `getTransactionsOnDateWaterUsage` method in `department_daily_reports_o` to calculate water usage based on transactions for a given date or date range.
- Updated department daily reports routes to include `water_usage` in the output.
2025-09-03 14:54:30 +02:00
Jeppe Bundgaard 97c448b5b6 Add is_wash field to products and support wash statistics in reports
- Introduced `is_wash` field to `products_o` for marking wash-related products.
- Updated `productsRoute` to handle `is_wash` in product creation and editing.
- Added `getTransactionsOnDateWashesCount` method in `department_daily_reports_o` for calculating wash-related transactions in reports.
- Adjusted department daily reports routes to include wash statistics output.
2025-09-03 14:03:02 +02:00
Jeppe Bundgaard 3dca3c8a24 Add support for date range in department daily reports
- Introduced optional `date_to` parameter across relevant routes and methods for handling date ranges in department daily reports.
- Added `getDate_to` method and refactored date validation logic into `validateDateLocally` for reuse and reduced redundancy.
- Updated SQL queries in `department_daily_reports_o` to support date range queries using `BETWEEN`.
- Enhanced error handling and parameter validation for date-related inputs.
- Cleaned up comments and redundant code for improved readability.
2025-09-03 12:52:03 +02:00
Jepp9350 8c70e6e3bc Enhance booking handling with service options and transactions
Added support for including customer name, department name, and parsed services in `asArray()` method. Introduced functionality for creating transactions, linking bookings to orders, and properly handling related services. Improved department daily report handling and removed unnecessary fields.
2025-04-16 12:37:57 +02:00
Jepp9350 8aee687106 Add new booking handling features and improve validations
Introduced support for a `data` property in bookings, extended form handling with additional validation and input fields, and added functionality for retrieving booking counts by date and status. Improved safety seal labeling and enhanced PDF generation comments.
2025-03-27 10:53:54 +01:00
Jepp9350 32f0a1548f Add customer-specific filtering and refactor order invoice logic
Introduced customer attribute-based filtering for individual invoicing and enhanced collected order invoice processing with proper associations to customers and orders. Added new endpoints, fields, and utility methods to streamline data retrieval, ensure consistency, and support new use cases like 'Ready to Invoice'. Includes minor fixes, validations, and optimizations throughout the affected modules.
2025-03-13 14:35:49 +01:00
Jepp9350 2038547d1c Enhance department report handling with date support
Added date parameter support for department daily reports, including validation, new functions, and route updates. Improved functionality allows fetching or creating reports for specific dates and prevents duplicate entries for the same date. Introduced a standardized date format within the API.
2025-03-06 14:37:32 +01:00
Jepp9350 cb62c66e5b Add earnings calculation and enhance department data handling
Introduced a method to calculate department earnings on a given date. Enhanced department object with new properties (dimension, created_at, updated_at) and improved data serialization for flexibility. Updated routes to accommodate these additions for more robust department insights.
2025-03-04 16:23:13 +01:00
Jepp9350 d6ed51f9ba Add endpoint to fetch the latest department daily report
Introduced a new method in `department_daily_reports_o` to select the latest daily report for a department. Added a corresponding API route to fetch the latest report details for a given department ID, with appropriate validations and access control measures. Adjusted parameter handling logic to enhance request validation.
2025-03-04 15:19:40 +01:00
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