Add dynamic_images_vehicle_type column to legacy self-serve schemas, update wash flow logic, and add unit tests for schema compatibility.
This commit is contained in:
@@ -253,6 +253,7 @@ class selfserve_wash_flow implements selfserve_wash_flow_i
|
||||
'description' => $row['description'] === null ? null : (string)$row['description'],
|
||||
'services' => $this->normalizeJsonArray($row['services'] ?? null),
|
||||
'buttons' => $this->normalizeJsonArray($row['buttons'] ?? null),
|
||||
'dynamic_images_vehicle_type' => $row['dynamic_images_vehicle_type'] ? (int)$row['dynamic_images_vehicle_type'] : null,
|
||||
];
|
||||
}, (new selfserve_wash_session_tasks_o())->listBySession($sessionId));
|
||||
|
||||
@@ -407,6 +408,7 @@ class selfserve_wash_flow implements selfserve_wash_flow_i
|
||||
'order_priority' => (int)($task['order_priority'] ?? 0),
|
||||
'services' => $this->normalizeServiceNames($this->normalizeJsonArray($task['services'] ?? null)),
|
||||
'buttons' => $this->normalizeIntArray($this->normalizeJsonArray($task['buttons'] ?? null)),
|
||||
'dynamic_images_vehicle_type' => (int)($task['dynamic_images_vehicle_type'] ?? 0),
|
||||
];
|
||||
}
|
||||
usort($activeTasks, static fn(array $a, array $b): int => $a['order_priority'] <=> $b['order_priority']);
|
||||
@@ -736,7 +738,7 @@ class selfserve_wash_flow implements selfserve_wash_flow_i
|
||||
(string)$task['description'],
|
||||
$task['services'],
|
||||
$task['buttons'],
|
||||
$task['dynamic_images_vehicle_type'] ?? null,
|
||||
(int)($task['dynamic_images_vehicle_type'] ?? 0) ?: null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user