mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 17:31:14 -05:00
feat: Implement strict type enforcement
This commit is contained in:
@@ -157,7 +157,7 @@ export function DesignerForm({ onSubmit, onCancel, initialData }: DesignerFormPr
|
||||
<Label>Entity Type *</Label>
|
||||
<RadioGroup
|
||||
value={watch('person_type')}
|
||||
onValueChange={(value) => setValue('person_type', value as any)}
|
||||
onValueChange={(value) => setValue('person_type', value as 'company' | 'individual' | 'firm' | 'organization')}
|
||||
className="grid grid-cols-2 md:grid-cols-4 gap-4"
|
||||
>
|
||||
<div className="flex items-center space-x-2">
|
||||
|
||||
@@ -160,7 +160,7 @@ export function ManufacturerForm({ onSubmit, onCancel, initialData }: Manufactur
|
||||
<Label>Entity Type *</Label>
|
||||
<RadioGroup
|
||||
value={watch('person_type')}
|
||||
onValueChange={(value) => setValue('person_type', value as any)}
|
||||
onValueChange={(value) => setValue('person_type', value as 'company' | 'individual' | 'firm' | 'organization')}
|
||||
className="grid grid-cols-2 md:grid-cols-4 gap-4"
|
||||
>
|
||||
<div className="flex items-center space-x-2">
|
||||
|
||||
@@ -157,7 +157,7 @@ export function OperatorForm({ onSubmit, onCancel, initialData }: OperatorFormPr
|
||||
<Label>Entity Type *</Label>
|
||||
<RadioGroup
|
||||
value={watch('person_type')}
|
||||
onValueChange={(value) => setValue('person_type', value as any)}
|
||||
onValueChange={(value) => setValue('person_type', value as 'company' | 'individual' | 'firm' | 'organization')}
|
||||
className="grid grid-cols-2 md:grid-cols-4 gap-4"
|
||||
>
|
||||
<div className="flex items-center space-x-2">
|
||||
|
||||
@@ -142,7 +142,7 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }:
|
||||
status: initialData?.status || 'Operating',
|
||||
opening_date: initialData?.opening_date || '',
|
||||
closing_date: initialData?.closing_date || '',
|
||||
location_id: (initialData as any)?.location_id || undefined,
|
||||
location_id: initialData?.location_id || undefined,
|
||||
website_url: initialData?.website_url || '',
|
||||
phone: initialData?.phone || '',
|
||||
email: initialData?.email || '',
|
||||
|
||||
@@ -157,7 +157,7 @@ export function PropertyOwnerForm({ onSubmit, onCancel, initialData }: PropertyO
|
||||
<Label>Entity Type *</Label>
|
||||
<RadioGroup
|
||||
value={watch('person_type')}
|
||||
onValueChange={(value) => setValue('person_type', value as any)}
|
||||
onValueChange={(value) => setValue('person_type', value as 'company' | 'individual' | 'firm' | 'organization')}
|
||||
className="grid grid-cols-2 md:grid-cols-4 gap-4"
|
||||
>
|
||||
<div className="flex items-center space-x-2">
|
||||
|
||||
@@ -229,8 +229,8 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
|
||||
_tempNewRideModel: tempNewRideModel
|
||||
};
|
||||
|
||||
// Pass clean data to parent
|
||||
await onSubmit(metricData as any);
|
||||
// Pass clean data to parent with extended fields
|
||||
await onSubmit(metricData);
|
||||
|
||||
toast({
|
||||
title: isEditing ? "Ride Updated" : "Submission Sent",
|
||||
|
||||
@@ -39,7 +39,7 @@ type RideModelFormData = z.infer<typeof rideModelSchema>;
|
||||
interface RideModelFormProps {
|
||||
manufacturerName: string;
|
||||
manufacturerId?: string;
|
||||
onSubmit: (data: RideModelFormData) => void;
|
||||
onSubmit: (data: RideModelFormData & { _technical_specifications?: unknown[] }) => void;
|
||||
onCancel: () => void;
|
||||
initialData?: Partial<RideModelFormData & {
|
||||
id?: string;
|
||||
@@ -87,11 +87,11 @@ export function RideModelForm({
|
||||
|
||||
|
||||
const handleFormSubmit = (data: RideModelFormData) => {
|
||||
// Include relational technical specs
|
||||
// Include relational technical specs with extended type
|
||||
onSubmit({
|
||||
...data,
|
||||
_technical_specifications: technicalSpecs
|
||||
} as any);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user