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
+41 -1
View File
@@ -8843,6 +8843,47 @@ paths:
'403':
$ref: '#/components/responses/Forbidden'
/modules/self-serve/lane/wash/my-active-wash:
get:
tags:
- Modules
summary: Get the authenticated customer's active self-serve wash
description: |
Returns the latest active self-serve wash for the authenticated customer,
without requiring the frontend to know or poll a lane id.
operationId: getMyActiveSelfServeWash
responses:
'200':
description: Active self-serve wash details resolved
content:
application/json:
schema:
type: object
properties:
lane_id:
type: integer
status:
type: string
in_progress:
type: boolean
elapsed_minutes:
type: integer
session:
type: object
nullable: true
customer:
type: object
nullable: true
vehicle:
type: object
nullable: true
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
/modules/self-serve/sessions:
get:
tags:
@@ -18688,4 +18729,3 @@ components:
data:
$ref: '#/components/schemas/DepartmentDailyReportOutsideHoursTrendPayload'