import {
  BaseListResult,
  GetRawOutListParams,
  GetWarehousingFlowingListParams,
  RawMaterialOutStreamListData,
  WarehousingListData,
} from '@models';
import {request} from './request';

const BASE_URL = '/warehousing';

/** 获取入库流水 */
export function getWarehousingFlowList(
  data: GetWarehousingFlowingListParams,
  signal?: AbortSignal,
): BaseListResult<WarehousingListData> {
  return request({
    method: 'GET',
    data,
    url: `${BASE_URL}/warehousingFlowing`,
    signal,
  });
}

/** 入库流水导出 */
export function exportWarehousing(data: GetWarehousingFlowingListParams): any {
  return request({
    method: 'GET',
    data,
    url: `${BASE_URL}/export`,
    skipError: true,
  });
}

/** 出库流水 */
export function getRawOutList(
  data: GetRawOutListParams,
  signal?: AbortSignal,
): BaseListResult<RawMaterialOutStreamListData> {
  return request({
    method: 'GET',
    url: '/askGoods/getRemoval',
    data,
    signal,
  });
}

/** 导出出库流水 */
export function exportRawOut(data: GetRawOutListParams): any {
  return request({
    method: 'GET',
    url: '/askGoods/export',
    skipError: true,
    data,
  });
}
