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

export type BaseInventoryAdjustment = {
  id: number;
  increase: number;
  decrease: number;
  note: string;
  product_warehouse_id: number;
  product_warehouse: {
    id: number;
    quantity: number;
    product_id: number;
    warehouse_id: number;
    product: Product;
    warehouse: Warehouse;
  };
};

export type InventoryAdjustment = BaseMetadata & BaseInventoryAdjustment;

export type CreateInventoryAdjustmentPayload = {
  product_id: number;
  warehouse_id: number;
  transaction_type: string;
  quantity: number;
  note: string;
};

export type UpdateInventoryAdjustmentPayload =
  Partial<CreateInventoryAdjustmentPayload>;
