feat: Implement strict type enforcement

This commit is contained in:
gpt-engineer-app[bot]
2025-10-16 13:56:32 +00:00
parent 95679c1067
commit 3bcd9e03fa
10 changed files with 379 additions and 80 deletions

View File

@@ -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">

View File

@@ -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">

View File

@@ -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">

View File

@@ -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 || '',

View File

@@ -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">

View File

@@ -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",

View File

@@ -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 (