import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InfoTemporaryVO, InfoTemporaryForm, InfoTemporaryQuery } from '@/api/supplier/infoTemporary/types';

/**
 * 查询供应商临时信息列表
 * @param query
 * @returns {*}
 */

export const listInfoTemporary = (query?: InfoTemporaryQuery): AxiosPromise<InfoTemporaryVO[]> => {
  return request({
    url: '/customer/infoTemporary/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询供应商临时信息详细
 * @param id
 */
export const getInfoTemporary = (id: string | number): AxiosPromise<InfoTemporaryVO> => {
  return request({
    url: '/customer/infoTemporary/' + id,
    method: 'get'
  });
};

/**
 * 新增供应商临时信息
 * @param data
 */
export const addInfoTemporary = (data: InfoTemporaryForm) => {
  return request({
    url: '/customer/infoTemporary',
    method: 'post',
    data: data
  });
};

/**
 * 修改供应商临时信息
 * @param data
 */
export const updateInfoTemporary = (data: InfoTemporaryForm) => {
  return request({
    url: '/customer/infoTemporary',
    method: 'put',
    data: data
  });
};

/**
 * 删除供应商临时信息
 * @param id
 */
export const delInfoTemporary = (id: string | number | Array<string | number>) => {
  return request({
    url: '/customer/infoTemporary/' + id,
    method: 'delete'
  });
};
