import ISummary from '@/core/models/summary';
import { TspProviderResponseStatus } from '@/shared/catalog';
import { IEnumTranslate } from '@/shared/models/enum_translate.type';

export interface IPosSaleInvoicesRawResponse {
  id: string;
  code: string;
  invoice_date: string;
  notes?: string;
  total_amount: string;
  pos: Pos;
  consumer_account: ConsumerAccount;
  created_at: string;
  items_count: number;
  payments: Payments[];
}

export interface IPosSaleInvoicesResponse extends IPosSaleInvoicesRawResponse {}

export interface IPosSaleInvoicesSummaryRawResponse {
  id: string;
  code: string;
  invoice_number: number;
  invoice_date: string;
  created_at: string;
  total_amount: string;
  customer: Customer;
  fiscal: null;
  status: IEnumTranslate<TspProviderResponseStatus>;
}
export interface IPosSaleInvoicesSummaryResponse extends IPosSaleInvoicesSummaryRawResponse {}

interface ConsumerAccount {
  role: string;
  account: Account;
}

interface Account {
  username: string;
}

interface Pos extends ISummary {
  complex: Complex;
}

interface Complex extends ISummary {
  business_activity: ISummary;
}

interface Payments {
  amount: string;
  paid_at?: string;
  payment_method: string;
}

interface Customer {
  type: string;
  individual: Individual;
  legal: Legal;
}

interface Individual {
  first_name: string;
  last_name: string;
  national_code: string;
  mobile_number: string;
}

interface Legal {
  company_name: string;
  economic_code: string;
  registration_number: string;
}
