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

@@ -72,7 +72,11 @@ export function validateEntityData(entityType: string, data: any): ValidationRes
case 'designer':
case 'operator':
case 'property_owner':
if (!data.company_type) errors.push('Company type is required');
if (!data.company_type) {
errors.push(`Company type is required (expected: ${entityType})`);
} else if (data.company_type !== entityType) {
errors.push(`Company type mismatch: expected '${entityType}' but got '${data.company_type}'`);
}
if (data.founded_year) {
const year = parseInt(data.founded_year);
const currentYear = new Date().getFullYear();