Implement strict type enforcement plan

This commit is contained in:
gpt-engineer-app[bot]
2025-10-16 14:10:35 +00:00
parent 3bcd9e03fa
commit bc4a444138
25 changed files with 161 additions and 132 deletions

28
src/types/company.ts Normal file
View File

@@ -0,0 +1,28 @@
/**
* Company-related type definitions
*/
import { ImageAssignments } from '@/components/upload/EntityMultiImageUploader';
export interface CompanyFormData {
name: string;
slug: string;
description?: string;
company_type: 'manufacturer' | 'designer' | 'operator' | 'property_owner';
person_type: 'company' | 'individual' | 'firm' | 'organization';
website_url?: string;
founded_year?: number;
headquarters_location?: string;
images?: ImageAssignments;
}
export interface TempCompanyData {
name: string;
slug: string;
company_type: 'manufacturer' | 'designer' | 'operator' | 'property_owner';
person_type: 'company' | 'individual' | 'firm' | 'organization';
description?: string;
founded_year?: number;
headquarters_location?: string;
website_url?: string;
}

View File

@@ -259,4 +259,32 @@ export interface UserTopListItem {
updated_at: string;
// Populated via joins
entity?: Park | Ride | Company;
}
// Extended company interface with aggregated stats
export interface CompanyWithStats extends Company {
ride_count?: number;
coaster_count?: number;
model_count?: number;
park_count?: number;
}
// Audit log entry - matches actual profile_audit_log table structure
export interface AuditLogEntry {
id: string;
user_id: string;
changed_by: string;
action: string;
changes: Record<string, unknown> | null;
ip_address_hash: string;
user_agent: string;
created_at: string;
}
// Activity entry - flexible structure for mixed activity types
export interface ActivityEntry {
id: string;
type?: 'review' | 'credit' | 'submission' | 'ranking';
created_at: string;
[key: string]: unknown; // Allow any additional properties from different activity types
}