export type InventoryStatus = 'normal' | 'low_stock' | 'out_of_stock';

export interface InventoryItem {
    id: string;
    sku: string;
    name: string;
    quantity: number;
    unit: string;
    warehouse: string;
    status: InventoryStatus;
    minStock?: number;
    maxStock?: number;
    lastUpdated: string;
    category?: string;
    description?: string;
}

export type InventoryList = {
    data: InventoryItem[];
    total: number;
    success: boolean;
};

export interface InventoryParams {
    current?: number;
    pageSize?: number;
    sku?: string;
    name?: string;
    warehouse?: string;
    status?: InventoryStatus;
    sorter?: Record<string, any>;
    filter?: Record<string, any>;
}

export interface InventoryLogItem {
    id: string;
    inventoryId: string;
    type: 'in' | 'out' | 'adjust'; // 入库 | 出库 | 盘点调整
    quantity: number; // 变动数量（正数=增加，负数=减少）
    beforeQuantity: number;
    afterQuantity: number;
    operator: string;
    remark?: string;
    createdAt: string;
}

export interface AdjustInventoryParams {
    id: string;
    type: 'in' | 'out' | 'adjust';
    quantity: number;
    remark: string;
}
