import ISummary from '@/core/models/summary';

export interface IPosInfoRawResponse {
  id: number;
  name: string;
  code: string;
  description: string;
  bankAccountId: number;
  inventoryId: number;
  createdAt: string;
  updatedAt: string;
  deletedAt: null;
  inventory: ISummary;
}

export interface IPosInfoResponse extends IPosInfoRawResponse {}

export interface IPosStockRawResponse {
  id: number;
  quantity: number;
}
export interface IPosStockResponse extends IPosStockRawResponse {}

export interface IPosProductCategoriesRawResponse {
  id: number;
  name: string;
  totalQuantity: number;
  productCount: number;
}
export interface IPosProductCategoriesResponse extends IPosProductCategoriesRawResponse {}

export interface IPosOrderRequest {
  customerId?: number;
}

export interface IPosOrderRawResponse {
  id: number;
  orderNumber: string;
  totalAmount: number;
  paidAmount: number;
  status: string;
  description?: string;
  createdAt: string;
  updatedAt: string;
  deletedAt?: string;
  customer?: {
    id: number;
    firstName: string;
    lastName: string;
  };
  orderItems: {
    count: number;
    unitPrice: number;
    totalPrice: number;
  }[];
}

export interface IPosOrderResponse extends Omit<IPosOrderRawResponse, 'customer'> {
  customer?: {
    id: number;
    name: string;
  };
}
export interface IPosHeldOrderRawResponse extends IPosOrderResponse {}
export interface IPosHeldOrderResponse extends IPosHeldOrderRawResponse {}

export interface IPosOrderConfirmedResponse {
  invoiceId: number;
}
