import request from '@/utils/request';

// 库存
/**
 * 查询列表
 * @param {*} params
 * @returns
 */
export const getStoreList = (params) => request('/store', { params });

/**
 * 新增
 * @param {*} data
 * @returns
 */
export const addStore = (data) => request('/store', { method: 'post', data });

/**
 * 详情
 * @param {*} id
 * @returns
 */
export const getStoreById = (id) => request(`/store/${id}`);

/**
 * 编辑
 *  @param {*} id
 * @param {*} data
 * @returns
 */
export const updataStore = (id, data) => request(`/store/${id}`, { method: 'put', data });

/**
 * 删除
 * @param {*} id
 * @returns
 */
export const deleteStore = (id) => request(`/store/${id}`, { method: 'delete' });

/**
 * 导出
 * @param {*} params
 * @returns
 */
export const storeExport = (params) => request('/store/export',  { download: true, params });


// 库存分类
/**
 * 查询列表
 * @param {*} params
 * @returns
 */
export const getStoreTypeList = (params) => request('/storeType', { params });

/**
 * 新增
 * @param {*} data
 * @returns
 */
export const addStoreType = (data) => request('/storeType', { method: 'post', data });

/**
 * 详情
 * @param {*} id
 * @returns
 */
export const getStoreTypeById = (id) => request(`/storeType/${id}`);

/**
 * 编辑
 *  @param {*} id
 * @param {*} data
 * @returns
 */
export const updataStoreType = (id, data) => request(`/storeType/${id}`, { method: 'put', data });

/**
 * 删除
 * @param {*} id
 * @returns
 */
export const deleteStoreType = (id) => request(`/storeType/${id}`, { method: 'delete' });

// 库存日志

/**
 * 查询列表
 * @param {*} params
 * @returns
 */
export const getStoreLogList = (params) => request('/storeLog', { params });

/**
 * 新增
 * @param {*} data
 * @returns
 */
export const addStoreLog = (data) => request('/storeLog', { method: 'post', data });


/**
 * 导出
 * @param {*} params
 * @returns
 */
 export const storeLogExport = (params) => request('/storeLog/export',  { download: true, params });