/**
 * Company-related type definitions
 */

import { ImageAssignments } from '@/components/upload/EntityMultiImageUploader';

export interface UploadedImage {
  url: string;
  cloudflare_id?: string;
  file?: File;
  isLocal?: boolean;
  caption?: string;
}

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;
}

export interface TempParkData {
  name: string;
  slug: string;
  park_type: string;
  status: string;
  description?: string;
  opening_date?: string;
  closing_date?: string;
  operator_id?: string;
  property_owner_id?: string;
  website_url?: string;
  phone?: string;
  email?: string;
  location?: {
    name: string;
    city?: string;
    state_province?: string;
    country: string;
    postal_code?: string;
    latitude: number;
    longitude: number;
  };
  images?: {
    uploaded: UploadedImage[];
    banner_assignment?: number | null;
    card_assignment?: number | null;
  };
  _tempNewOperator?: TempCompanyData;
  _tempNewPropertyOwner?: TempCompanyData;
}

export interface TempRideModelData {
  name: string;
  slug: string;
  category: string;
  ride_type: string;
  description?: string;
  images?: {
    uploaded: UploadedImage[];
    banner_assignment?: number | null;
    card_assignment?: number | null;
  };
  _technical_specifications?: TechnicalSpecification[];
}

export interface TechnicalSpecification {
  id?: string;
  spec_name: string;
  spec_value: string;
  spec_type: 'string' | 'number' | 'boolean' | 'date';
  category?: string;
  unit?: string;
  display_order: number;
}

export interface CoasterStat {
  id?: string;
  stat_type: string;
  value: string;
  unit?: string;
}

export type CoasterStatValue = string | number | null;
export type TechnicalSpecValue = string | number | null;
