export type PurchaseRealizationListItem = {
  purchase_id: string;
  purchase_no: string;
  purchase_type: string;
  purchase_date: string;
  supplier_name: string;
  status: string;
  qty_opening: number;
  qty_remaining: number;
  qty_sold: number;
  qty_shrinkage: number;
  revenue_total: number;
  profit_loss_total: number;
  agent_profit_total: number;
};

export type PurchaseRealizationEntryItem = {
  id: string;
  event_type: string;
  reference_type: string;
  reference_id: string | null;
  lot_id: string | null;
  lot_code: string | null;
  occurred_at: string;
  qty_in: number;
  qty_out: number;
  qty_shrinkage: number;
  amount_cost: number;
  amount_revenue: number;
  amount_expense: number;
  amount_profit: number;
  agent_amount: number;
  notes: string | null;
};

export type PurchaseRealizationDetail = {
  purchase: {
    id: string;
    purchase_no: string;
    purchase_type: string;
    purchase_date: string;
    supplier_name: string;
    status: string;
    agent_name: string | null;
    buyout_source_agent_name: string | null;
    profit_share_scheme_name: string | null;
    share_agent_percent: number | null;
  };
  summary: {
    status: string;
    qty_opening: number;
    qty_remaining: number;
    qty_sold: number;
    qty_returned: number;
    qty_shrinkage: number;
    cost_opening_total: number;
    cost_additional_total: number;
    revenue_total: number;
    profit_loss_total: number;
    agent_share_percent: number | null;
    agent_profit_total: number;
    closed_at: string | null;
  };
  entries: PurchaseRealizationEntryItem[];
};
