Fix: Implement company submission and validation plan

This commit is contained in:
gpt-engineer-app[bot]
2025-10-10 19:28:15 +00:00
parent c62935818a
commit 5adf855b04
7 changed files with 591 additions and 21 deletions

View File

@@ -96,11 +96,11 @@ export const rideValidationSchema = z.object({
// Company Schema (Manufacturer, Designer, Operator, Property Owner)
export const companyValidationSchema = z.object({
name: z.string().min(1, 'Company name is required').max(200, 'Name must be less than 200 characters'),
slug: z.string().min(1, 'Slug is required').regex(/^[a-z0-9-]+$/, 'Slug must contain only lowercase letters, numbers, and hyphens'),
name: z.string().trim().min(1, 'Company name is required').max(200, 'Name must be less than 200 characters'),
slug: z.string().trim().min(1, 'Slug is required').regex(/^[a-z0-9-]+$/, 'Slug must contain only lowercase letters, numbers, and hyphens'),
company_type: z.enum(['manufacturer', 'designer', 'operator', 'property_owner']).optional(),
description: z.string().max(2000, 'Description must be less than 2000 characters').optional(),
company_type: z.string().min(1, 'Company type is required'),
person_type: z.enum(['company', 'individual', 'firm', 'organization']).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_date: z.string().optional(),
founded_date_precision: z.enum(['day', 'month', 'year']).optional(),