import ISummary from '@/core/models/summary';
import { TCustomerInfo, TPosOrderGoodPayload } from '@/domains/pos/modules/landing/models';
import { UnitType } from '@/utils';

export interface ISalesInvoicesRawResponse {
  id: string;
  code: string;
  invoice_date: string;
  total_amount: string;
  items: Item[];
  payments: Payment[];
  customer?: TCustomerInfo;
  notes?: string;
  unknown_customer?: UnknownCustomer;
}
export interface ISalesInvoicesResponse extends ISalesInvoicesRawResponse {}

export interface ISalesInvoicesRequest {}

interface UnknownCustomer {
  name?: string;
  national_code?: string;
}

interface Payment {
  amount: string;
  paid_at: string;
  payment_method: string;
}

interface Item {
  unit_type: UnitType;
  discount: string;
  quantity: string;
  total_amount: string;
  unit_price: string;
  payload: TPosOrderGoodPayload;
  good: Good;
  notes?: string;
}

interface Good {
  id: string;
  name: string;
  sku: string;
  barcode: null;
  local_sku: null;
  pricing_model: string;
  unit_type: string;
  category: ISummary;
}
