mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 06:11:12 -05:00
Approve database migration
This commit is contained in:
@@ -20,7 +20,9 @@ export const parkValidationSchema = z.object({
|
||||
const date = new Date(val);
|
||||
return date <= new Date();
|
||||
}, 'Opening date cannot be in the future'),
|
||||
opening_date_precision: z.enum(['day', 'month', 'year']).optional(),
|
||||
closing_date: z.string().optional(),
|
||||
closing_date_precision: z.enum(['day', 'month', 'year']).optional(),
|
||||
location_id: z.string().uuid().optional().nullable(),
|
||||
website_url: z.string().optional().refine((val) => {
|
||||
if (!val || val === '') return true;
|
||||
@@ -63,7 +65,9 @@ export const rideValidationSchema = z.object({
|
||||
park_id: z.string().uuid().optional().nullable(),
|
||||
designer_id: z.string().uuid().optional().nullable(),
|
||||
opening_date: z.string().optional(),
|
||||
opening_date_precision: z.enum(['day', 'month', 'year']).optional(),
|
||||
closing_date: z.string().optional(),
|
||||
closing_date_precision: z.enum(['day', 'month', 'year']).optional(),
|
||||
height_requirement: z.number().min(0, 'Height requirement must be positive').max(300, 'Height requirement must be less than 300cm').optional(),
|
||||
age_requirement: z.number().min(0, 'Age requirement must be positive').max(100, 'Age requirement must be less than 100').optional(),
|
||||
capacity_per_hour: z.number().min(0, 'Capacity must be positive').optional(),
|
||||
@@ -98,6 +102,8 @@ export const companyValidationSchema = z.object({
|
||||
company_type: z.string().min(1, 'Company type is required'),
|
||||
person_type: z.enum(['company', 'individual', 'firm', 'organization']).optional(),
|
||||
founded_year: z.number().min(1800, 'Founded year must be after 1800').max(currentYear, `Founded year cannot be in the future`).optional(),
|
||||
founded_date: z.string().optional(),
|
||||
founded_date_precision: z.enum(['day', 'month', 'year']).optional(),
|
||||
headquarters_location: z.string().max(200, 'Location must be less than 200 characters').optional(),
|
||||
website_url: z.string().optional().refine((val) => {
|
||||
if (!val || val === '') return true;
|
||||
|
||||
Reference in New Issue
Block a user