Implement plan

This commit is contained in:
gpt-engineer-app[bot]
2025-10-19 19:28:04 +00:00
parent 5a138688bc
commit 5fa073cca2
3 changed files with 166 additions and 30 deletions

View File

@@ -85,6 +85,10 @@ export function validateEntityDataStrict(
if (!hasLocation && !hadLocation) {
result.blockingErrors.push('Location is required for parks');
}
// Block explicit removal of required location
if (hadLocation && data.location_id === null) {
result.blockingErrors.push('Cannot remove location from a park - location is required');
}
if (data.opening_date && data.closing_date) {
const opening = new Date(data.opening_date);
const closing = new Date(data.closing_date);
@@ -107,6 +111,10 @@ export function validateEntityDataStrict(
if (!hasPark && !hadPark) {
result.blockingErrors.push('Park is required for rides');
}
// Block explicit removal of required park assignment
if (hadPark && data.park_id === null) {
result.blockingErrors.push('Cannot remove park from a ride - park is required');
}
if (data.max_speed_kmh && (data.max_speed_kmh < 0 || data.max_speed_kmh > 300)) {
result.blockingErrors.push('Max speed must be between 0 and 300 km/h');
}