export type JitSaleLineBootstrap = {
  id: string;
  code: string;
  name: string;
  is_mangkok: boolean;
};

export type JitSaleListItem = {
  id: string;
  sale_no: string;
  sale_date: string;
  buyer: {
    id: string;
    code: string;
    name: string;
  };
  buyer_currency_code: string;
  company_currency_code: string;
  exchange_rate: number | null;
  status: string;
  item_count: number;
  total_nominal_buyer: number;
  total_nominal_company: number;
  total_agent_commission: number;
};

export type JitSaleDetail = {
  id: string;
  sale_no: string;
  sale_date: string;
  close_date: string | null;
  buyer: {
    id: string;
    code: string;
    name: string;
  };
  courier: {
    id: string;
    code: string;
    name: string;
  } | null;
  buyer_currency_code: string;
  company_currency_code: string;
  exchange_rate: number | null;
  shipping_cost_buyer: number;
  shipping_cost_company: number;
  shipping_receipt_file_url: string | null;
  total_nominal_buyer: number;
  total_nominal_company: number;
  total_agent_commission: number;
  status: string;
  notes: string | null;
  created_at: string;
  lines: Array<{
    id: string;
    grade: {
      id: string;
      code: string;
      name: string;
    };
    qty_planned: number;
    qty_actual_sold: number | null;
    mal_unit_price: number;
    selling_price_planned: number;
    selling_price_actual: number | null;
    agent: {
      id: string;
      code: string;
      name: string;
    } | null;
    profit_share_scheme: {
      id: string;
      code: string;
      name: string;
    } | null;
    agent_name: string | null;
    agent_share_percent: number | null;
    notes: string | null;
  }>;
};
