export interface ICategoryPivot {
  ticket_id: number
  category_id: number
}

export interface ITicketCategory {
  name: string
  pivot: ICategoryPivot
}

export interface ITicket {
  id: number
  title: string
  status: "open" | "close"
  is_resolved: 0 | 1
  created_at: string
  updated_at: string
  categories: ITicketCategory[]
}

export interface ICategory {
  id: number
  name: string
  slug: string
  is_visible: 0 | 1
  created_at: string
  updated_at: string
}

export interface IMessageAttachment {
  file_name: string;
  mime_type: string;
  temporary_url: string;
}

export interface IMessage {
  by_owner: boolean; 
  user_name?: string;
  message: string;
  created_at: string;
  attachments: IMessageAttachment[];
}

export interface ITicketCategoryContext {
  categories: ICategory[];
  setCategories: (list: ICategory[]) => void;

  loadingCategories: boolean;
  categoryError: string | null;

  loadCategories: () => Promise<void>;
}