import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LogisticsOrderQuotationVO, LogisticsOrderQuotationForm, LogisticsOrderQuotationQuery } from '@/api/amz/logisticsOrderQuotation/types';

/**
 * 查询物流订单确认列表
 * @param query
 * @returns {*}
 */

export const listLogisticsOrderQuotation = (query?: LogisticsOrderQuotationQuery): AxiosPromise<LogisticsOrderQuotationVO[]> => {
  return request({
    url: '/amz/logisticsOrderQuotation/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询物流订单确认详细
 * @param id
 */
export const getLogisticsOrderQuotation = (id: string | number): AxiosPromise<LogisticsOrderQuotationVO> => {
  return request({
    url: '/amz/logisticsOrderQuotation/' + id,
    method: 'get'
  });
};

/**
 * 新增物流订单确认
 * @param data
 */
export const addLogisticsOrderQuotation = (data: LogisticsOrderQuotationForm) => {
  return request({
    url: '/amz/logisticsOrderQuotation',
    method: 'post',
    data: data
  });
};

/**
 * 新增物流订单确认
 * @param data
 */
export const createLogisticsOrderQuotation = (data: LogisticsOrderQuotationForm) => {
  return request({
    url: '/amz/logisticsOrderQuotation/quotationOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改物流订单确认
 * @param data
 */
export const updateLogisticsOrderQuotation = (data: LogisticsOrderQuotationForm) => {
  return request({
    url: '/amz/logisticsOrderQuotation',
    method: 'put',
    data: data
  });
};

/**
 * 删除物流订单确认
 * @param id
 */
export const delLogisticsOrderQuotation = (id: string | number | Array<string | number>) => {
  return request({
    url: '/amz/logisticsOrderQuotation/' + id,
    method: 'delete'
  });
};
