Persist MyWash sessions on start command

This commit is contained in:
Jeppe Bundgaard
2026-06-04 08:18:31 +02:00
parent 2b6a8eedcc
commit 458fe7399d
3 changed files with 96 additions and 0 deletions
@@ -569,6 +569,30 @@ class moduleSelfServeRoute
'subuser_id' => $subuser === false ? null : (int)$subuser->id,
]);
$lane->execute($command, $args);
if ($command === selfserve_lane_command::START) {
try {
$license_plate = selfserve::standardize_registration(
(string)($args->license_plate ?: $lane->getLicensePlate())
);
if ($license_plate !== '') {
(new selfserve_wash_flow())->synchronizeSession(
$lane_id,
$license_plate,
$customer_number > 0 ? $customer_number : null,
false,
null,
false
);
}
} catch (\Throwable $e) {
error_log(
'Failed to persist self-serve START session for lane '
. $lane_id
. ': '
. $e->getMessage()
);
}
}
$response->success([
'id' => $lane->id,
'status' => $lane->getLaneStatus()->name,