Add "Get My Active Self-Serve Wash" endpoint and corresponding tests

- Introduced a new `/modules/self-serve/lane/wash/my-active-wash` endpoint to retrieve the authenticated customer's active self-serve wash.
- Implemented authentication and permission checks for secure access.
- Added detailed response handling for various scenarios, including 401, 403, and 404 statuses.
- Extended API documentation and OpenAPI spec to support the new endpoint.
- Updated unit and API tests to validate endpoint functionality and route wiring.
This commit is contained in:
Jeppe Bundgaard
2026-06-02 10:29:15 +02:00
parent f4b9d71d40
commit 72704b7806
6 changed files with 345 additions and 1 deletions
@@ -286,9 +286,12 @@ it('wires in-progress self-serve wash details endpoint', function (): void {
expect($moduleSelfServeRoute)->not->toBeFalse();
expect($moduleSelfServeRoute)->toContain('/modules/self-serve/lane/wash/in-progress');
expect($moduleSelfServeRoute)->toContain('/modules/self-serve/lane/wash/my-active-wash');
expect($moduleSelfServeRoute)->toContain('modules_selfserve_lane_wash_in_progress_view');
expect($moduleSelfServeRoute)->toContain('list_own_department_selfserve_vehicle_conditions');
expect($moduleSelfServeRoute)->toContain('requireInProgressWashDetailsAccess($lane_id)');
expect($moduleSelfServeRoute)->toContain('findLatestActiveSelfServeSessionForCustomer($customer_number)');
expect($moduleSelfServeRoute)->toContain('buildActiveSelfServeSessionResponse($session)');
expect($moduleSelfServeRoute)->toContain('(new department_lanes_o())->select($lane_id)');
expect($moduleSelfServeRoute)->toContain('self::requireDepartmentAccess((string)$department_lane->department->value())');
expect($moduleSelfServeRoute)->toContain('scopeInProgressWashResponseForCustomer');