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

export type BaseProductWarehouse = {
  id: number;
  product_id: number;
  warehouse_id: number;
  uom: Uom;
  quantity: number;
  transfer_available_qty?: number;
  product: Product;
  warehouse: Warehouse;
  project_flock_kandang?: {
    id: number;
    project_flock_id: number;
    kandang_id: number;
    period: number;
    project_flock?: {
      id: number;
      flock_name: string;
    };
  };
  week?: number | null;
};

export type ProductWarehouse = BaseMetadata & BaseProductWarehouse;

export type CreateProductWarehousePayload = {
  product_id: number;
  warehouse_id: number;
  quantity: number;
};

export type UpdateProductWarehousePayload = CreateProductWarehousePayload;
