export type TicketCategory = 'hardware_repair' | 'software_issue' | 'network' | 'printer' | 'account_access' | 'other';
export type TicketPriority = 'low' | 'medium' | 'high' | 'critical';
export type TicketStatus = 'open' | 'in_progress' | 'on_hold' | 'resolved' | 'closed';

export type Ticket = {
    id: number;
    ticket_number: string;
    title: string;
    description: string;
    category: TicketCategory;
    priority: TicketPriority;
    status: TicketStatus;
    location: string | null;
    equipment_type: string | null;
    requester: {
        id: number;
        name: string;
        department?: string;
    };
    assignee: {
        id: number;
        name: string;
    } | null;
    comments: TicketComment[];
    resolved_at: string | null;
    closed_at: string | null;
    created_at: string;
    updated_at: string;
};

export type TicketComment = {
    id: number;
    body: string;
    is_internal: boolean;
    user: {
        id: number;
        name: string;
        role?: string;
    };
    created_at: string;
};

export type PaginatedData<T> = {
    data: T[];
    current_page: number;
    last_page: number;
    per_page: number;
    total: number;
    from: number;
    to: number;
    prev_page_url: string | null;
    next_page_url: string | null;
    links: {
        url: string | null;
        label: string;
        active: boolean;
    }[];
};

export type DashboardStats = {
    open: number;
    in_progress: number;
    on_hold: number;
    resolved: number;
    closed: number;
    total: number;
    critical: number;
};

export type CategoryMap = Record<string, string>;
export type PriorityMap = Record<string, string>;
export type StatusMap = Record<string, string>;
