export interface ProductList {
  total: number;
  page: number;
  page_size: number;
  total_pages: number;
  has_next: boolean;
  has_previous: boolean;
  results: ProductListResult[];
}

export interface ProductListResult {
  id: number;
  images: { id: number; image: string }[];
  liked: boolean;
  meansurement: {
    id: number;
    name: string;
  } | null;
  inventory_id: null | string;
  product_id: string;
  code: string;
  name: string;
  short_name: string;
  weight_netto: null | string;
  weight_brutto: null | string;
  litr: null | string;
  box_type_code: null | string;
  box_quant: null | string;
  groups: { id: number; name: string };
  state: 'A' | 'P';
  payment_type: 'cash' | 'card' | null;
  barcodes: string;
  article_code: null | string;
  marketing_group_code: null | string;
  inventory_kinds: { id: number; name: string }[];
  sector_codes: { id: number; code: string }[];
  prices: {
    id: number;
    price: string;
    price_type: {
      id: number;
      name: string;
      code: string;
    };
  }[];
  balance: number;
}

export interface ProductDetail {
  id: number;
  images: { id: number; image: string | null }[];
  liked: boolean;
  meansurement: null | { id: number; name: string };
  inventory_id: null | string;
  product_id: string;
  code: string;
  name: string;
  short_name: string;
  weight_netto: null | string;
  weight_brutto: null | string;
  litr: null | string;
  box_type_code: null | string;
  box_quant: null | string;
  groups: { id: number; name: string }[];
  state: 'A' | 'P';
  barcodes: string;
  article_code: null | string;
  marketing_group_code: null | string;
  inventory_kinds: { id: number; name: string }[];
  sector_codes: { id: number; code: string }[];
  payment_type: null | 'cash' | 'card';
  balance: number;
  updated_at: string;
  prices: {
    id: number;
    price: string;
    price_type: {
      id: number;
      name: string;
      code: string;
    };
  }[];
}

export interface SearchData {
  products: SearchDataPro[];
}

export interface SearchDataPro {
  products: ProductListResult;
}

export interface FavouriteProduct {
  total: number;
  page: number;
  page_size: number;
  total_pages: number;
  has_next: boolean;
  has_previous: boolean;
  results: FavouriteProductRes[];
}

export interface FavouriteProductRes {
  id: number;
  images: { id: number; image: string }[];
  liked: boolean;
  meansurement: {
    id: number;
    name: string;
  } | null;
  inventory_id: null | string;
  product_id: string;
  code: string;
  name: string;
  short_name: string;
  weight_netto: null | string;
  weight_brutto: null | string;
  litr: null | string;
  box_type_code: null | string;
  box_quant: null | string;
  groups: { id: number; name: string };
  payment_type: 'cash' | 'card' | null;
  state: 'A' | 'P';
  barcodes: string;
  article_code: null | string;
  marketing_group_code: null | string;
  inventory_kinds: { id: number; name: string }[];
  sector_codes: { id: number; code: string }[];
  balance: number;
  prices: {
    id: number;
    price: string;
    price_type: {
      id: number;
      name: string;
      code: string;
    };
  }[];
}
