import { BaseMetadata } from '@/types/api/api-general';
import { Uom } from '@/types/api/master-data/uom';

export type BaseSupplier = {
  id: number;
  name: string;
  alias: string;
  pic: string;
  type: string;
  category: string;
  hatchery: string;
  phone: string;
  email: string;
  address: string;
  npwp: string;
  account_number: string;
  due_date: number;
  balance?: number;
  bank_name: string;
};

export type Supplier = BaseMetadata & BaseSupplier;

export type SupplierProducts = Supplier & {
  products?: Array<{
    id: number;
    name: string;
    ProductPrice: number;
    SellingPrice?: number;
    uom: Uom;
    flags: string[];
  }>;
};

export type CreateSupplierPayload = {
  name: string;
  alias: string;
  pic: string;
  type: string;
  category: string;
  hatchery: string;
  phone: string;
  email: string;
  address: string;
  npwp: string;
  account_number: string;
  due_date: number;
  balance?: number;
  bank_name: string;
};

export type UpdateSupplierPayload = CreateSupplierPayload;
