import {
  AddProductionRequisitionParams,
  AddQualityParams,
  AddRelcationParams,
  AddReportingParams,
  AddSellParams,
  AddUnProductionRequisitionParams,
  BaseResult,
  ReSendErrorParams,
} from '@models';
import {gsRequest, request} from './request';

/** 新增质检单 */
export function addQuality(data: AddQualityParams) {
  return gsRequest(`/addReceiveGoods`, data);
}

/** 新增生产领用单 */
export function addProductionRequisition(data: AddProductionRequisitionParams) {
  return gsRequest('/addAskGoods', data);
}

/** 新增非生产领用单 */
export function addUnProductionRequisition(
  data: AddUnProductionRequisitionParams,
) {
  return gsRequest('/addAskGoodsNoProd', data);
}

/** 新增报工单 */
export function addReporting(data: AddReportingParams) {
  return gsRequest('/prodStockInNotice', data);
}

/** 新增销售单 */
export function addSell(data: AddSellParams) {
  return gsRequest('/deliveryOrder', data);
}

/** 新增移库通知 */
export function addRelcation(data: AddRelcationParams) {
  return gsRequest('/transferNotice', data);
}

/** 重新上传 */
export function retryErrorInterface(data: ReSendErrorParams): BaseResult {
  return request({
    method: 'POST',
    url: '/gsPlugOut/anew',
    data,
  });
}
