export type ConsignmentCandidateLot = {
  lot_id: string;
  lot_code: string;
  grade: string;
  unit_code: string;
  warehouse: string;
  location: string | null;
  available_qty: number;
  unit_cost: number;
  mal_unit_price: number | null;
};

export type ConsignmentListItem = {
  id: string;
  consignment_no: string;
  consignment_date: string;
  sales: {
    id: string;
    code: string;
    name: string;
  };
  buyer: {
    id: string;
    code: string;
    name: string;
  };
  status: string;
  item_count: number;
  open_item_count: number;
  total_qty_consigned: number;
  total_qty_sold: number;
  total_qty_returned: number;
  total_qty_shrinkage: number;
};

export type ConsignmentDetail = {
  id: string;
  consignment_no: string;
  consignment_date: string;
  sales: {
    id: string;
    code: string;
    name: string;
  };
  buyer: {
    id: string;
    code: string;
    name: string;
  };
  status: string;
  notes: string | null;
  created_at: string;
  lines: Array<{
    id: string;
    lot_id: string;
    lot_code: string;
    grade: string;
    unit_code: string;
    warehouse: string;
    location: string | null;
    available_qty_snapshot: number;
    current_available_qty: number;
    qty_consigned: number;
    mal_unit_price_snapshot: number | null;
    agent_name_snapshot: string | null;
    agent_share_percent: number | null;
    unit_cost: number;
    status: string;
    notes: string | null;
    close_date: string | null;
    selling_price: number | null;
    qty_sold: number;
    qty_returned: number;
    qty_shrinkage: number;
    sales_commission: number;
    agent_commission: number;
  }>;
};
