mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 12:11:17 -05:00
Implement plan
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user