Fix TypeScript build errors

This commit is contained in:
gpt-engineer-app[bot]
2025-10-12 16:22:57 +00:00
parent 5637b37ebc
commit dd079bd5a5
12 changed files with 52 additions and 140 deletions

View File

@@ -101,7 +101,16 @@ export const companyValidationSchema = z.object({
company_type: z.enum(['manufacturer', 'designer', 'operator', 'property_owner']),
description: z.string().max(2000, 'Description must be less than 2000 characters').optional(),
person_type: z.enum(['company', 'individual', 'firm', 'organization']),
founded_year: z.number().min(1800, 'Founded year must be after 1800').max(currentYear, `Founded year cannot be in the future`).optional(),
founded_year: z.string()
.optional()
.transform(val => {
if (!val || val.trim() === '') return undefined;
const num = Number(val);
return isNaN(num) ? undefined : num;
})
.refine(val => val === undefined || (typeof val === 'number' && val >= 1800 && val <= currentYear), {
message: `Founded year must be between 1800 and ${currentYear}`
}),
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(),