import { AxiosInstance } from 'axios';
import { route as ziggyRoute } from 'ziggy-js';

declare global {
    interface Window {
        axios: AxiosInstance;
    }

    var route: typeof ziggyRoute;
}

export interface User {
    id: number;
    name: string;
    email: string;
    role: 'user' | 'partner' | 'admin';
    features?: string[];
    email_verified_at?: string;
    is_member: boolean;
    membership_started_at?: string;
    membership_expires_at?: string;
    coin_balance?: number;
    coin_name?: string;
    coin_abbreviation?: string;
    created_at: string;
    updated_at: string;
    shows?: Show[];
}

export interface Show {
    id: number;
    showId: string;
    title: string;
    description?: string;
    lineup?: (string | { id?: string; name?: string; img?: string; url_key?: string })[] | null;
    seitansai?: (string | { id?: string; name?: string; img?: string; url_key?: string })[] | null;
    graduation?: (string | { id?: string; name?: string; img?: string; url_key?: string })[] | null;
    start_time: number;
    type: string;
    price: number;
    coin_price?: number;
    banner_link?: string;
    is_promo: boolean;
    promo_price?: number;
    promo_coin_price?: number;
    is_active: boolean;
    is_live: boolean;
    is_replay: boolean;
    streamer_live: string;
    slug_live: string;
    url_live?: string;
    url_replay?: string;
    type_live: string;
    created_at: string;
    updated_at: string;
}

export interface PartnerShow {
    id: number;
    partner_id: number;
    showId: string;
    title: string;
    description?: string;
    lineup?: (string | { id?: string; name?: string; img?: string; url_key?: string })[] | null;
    seitansai?: (string | { id?: string; name?: string; img?: string; url_key?: string })[] | null;
    graduation?: (string | { id?: string; name?: string; img?: string; url_key?: string })[] | null;
    start_time: number;
    type: string;
    price: number;
    banner_link?: string;
    is_promo: boolean;
    promo_price?: number;
    is_active: boolean;
    is_live: boolean;
    is_replay: boolean;
    streamer_live: string;
    slug_live: string;
    url_live?: string;
    url_replay?: string;
    type_live: string;
    created_at: string;
    updated_at: string;
}

export interface PartnerSetting {
    id: number;
    partner_id: number;
    settings: Record<string, any>;
    created_at: string;
    updated_at: string;
}

export interface PartnerToken {
    token: string;
    showId: string;
    created_at: string;
    expires_at: string;
    ttl: number;
}

export interface Auth {
    user: User;
}

export interface ActivityLog {
    id: number;
    user_id?: number;
    action: string;
    model_type?: string;
    model_id?: number;
    description?: string;
    properties?: Record<string, any>;
    ip_address?: string;
    user_agent?: string;
    method?: string;
    url?: string;
    created_at: string;
    updated_at: string;
    user?: User;
}

export interface SharedData {
    name: string;
    quote: { message: string; author: string };
    auth: Auth;
    [key: string]: unknown;
}
