mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 19:51:12 -05:00
Implement strict type enforcement plan
This commit is contained in:
28
src/types/company.ts
Normal file
28
src/types/company.ts
Normal 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;
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user