import request from '/@/utils/request';
import type { InventoryOutStockListParams, InventoryOutStockItem } from './types';
import { AxiosPromise } from 'axios';

/**
 * 获取自动出库管理列表
 * @param data 
 * @returns 
 */
export function inventoryOutStockListApi(data: InventoryOutStockListParams) :AxiosPromise<{ list: InventoryOutStockItem[]; [key: string]: any;}> {
    return request({
        url: '/inventory/auto/out/stock/list',
        method: 'post',
        params:data
    })
}


/**
 * 添加自动出库项
 * @param data 
 * @returns 
 */
export function inventoryOutStockAdd(data: Partial<InventoryOutStockItem>) {
    return request({
        url: '/inventory/auto/out/stock/add',
        method: 'post',
        data
    })
}


/**
 * 更新自动出库项
 * @param data 
 * @returns 
 */
export function inventoryOutStockUpdate(data: Partial<InventoryOutStockItem>) {
    return request({
        url: '/inventory/auto/out/stock/update',
        method: 'post',
        data
    })
}



/**
 * 删除自动出库项
 * @param id 
 * @returns 
 */
export function inventoryOutStockDel(id: number) {
    return request({
        url: '/inventory/auto/out/stock/delete',
        method: 'post',
        params: { id }
    })
}