export type OrganizationType = 'artist' | 'venue' | 'promoter' | 'label' | 'creator' | 'media' | 'other';
export type OrganizationStatus = 'draft' | 'pending_review' | 'active' | 'suspended' | 'archived';
export type ProfileType = 'artist' | 'dj' | 'live_act' | 'venue' | 'promoter' | 'label' | 'creator' | 'media';
export type AvailabilityStatus = 'unknown' | 'available' | 'limited' | 'unavailable';
export type MatchRequestStatus = 'pending' | 'completed' | 'failed';
export type CiraCacheStatus = 'none' | 'bypassed' | 'hit' | 'partial_hit' | 'miss';
export type ResultType = 'profile' | 'opportunity' | 'event';

export interface User {
    id: string;
    name: string;
    email: string;
    locale: string;
    timezone: string;
    is_active: boolean;
    email_verified_at: string | null;
    last_login_at: string | null;
    created_at: string;
    updated_at: string;
}

export interface Organization {
    id: string;
    owner_id: string;
    name: string;
    slug: string;
    type: OrganizationType;
    country_code: string;
    city: string;
    region: string | null;
    postal_code: string | null;
    latitude: number | null;
    longitude: number | null;
    website: string | null;
    description: string | null;
    status: OrganizationStatus;
    verified_at: string | null;
    created_at: string;
    updated_at: string;
}

export interface Profile {
    id: string;
    organization_id: string | null;
    user_id: string | null;
    display_name: string;
    slug: string;
    headline: string | null;
    bio: string | null;
    profile_type: ProfileType;
    availability_status: AvailabilityStatus;
    travel_radius_km: number | null;
    base_city: string;
    base_country_code: string;
    latitude: number | null;
    longitude: number | null;
    website: string | null;
    instagram: string | null;
    soundcloud: string | null;
    bandcamp: string | null;
    spotify: string | null;
    youtube: string | null;
    press_kit_url: string | null;
    technical_rider_url: string | null;
    status: OrganizationStatus;
    verified_at: string | null;
    created_at: string;
    updated_at: string;
}

export interface StructuredQuery {
    target_type?: ResultType;
    genres?: string[];
    city?: string | null;
    country_code?: string | null;
    capability?: string | null;
    budget_min?: number | null;
}

export interface MatchResult {
    id: string;
    result_type: ResultType;
    profile_id: string | null;
    opportunity_id: string | null;
    event_id: string | null;
    score: number;
    rank: number;
    matched_criteria: string[];
    missing_criteria: string[];
    explanation: { text?: string; [key: string]: any };
    data_quality_score: number | null;
}

export interface MatchRequest {
    id: string;
    user_id: string;
    organization_id: string | null;
    shortlist_id: string | null;
    natural_language_query: string | null;
    structured_query: StructuredQuery;
    result_count: number;
    status: MatchRequestStatus;
    cache_status: CiraCacheStatus;
    duration_ms: number | null;
    completed_at: string | null;
    results?: MatchResult[];
    created_at: string;
}
