import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InoutrecordForm, InoutrecordId, InoutrecordIds, InoutrecordQuery, InoutrecordVO } from './types';

export const listInoutrecord = (query?: InoutrecordQuery): AxiosPromise<InoutrecordVO[]> => {
  return request({ url: '/wcs/inoutrecord/list', method: 'get', params: query });
};

export const getInoutrecord = (id: InoutrecordId): AxiosPromise<InoutrecordVO> => {
  return request({ url: '/wcs/inoutrecord/' + id, method: 'get' });
};

export const addInoutrecord = (data: InoutrecordForm) => {
  return request({ url: '/wcs/inoutrecord', method: 'post', data });
};

export const updateInoutrecord = (data: InoutrecordForm) => {
  return request({ url: '/wcs/inoutrecord', method: 'put', data });
};

export const delInoutrecord = (id: InoutrecordId | InoutrecordIds) => {
  return request({ url: '/wcs/inoutrecord/' + id, method: 'delete' });
};
