import request, { postBlob, getBlob, handleImport } from '@/utils/request'

export function workerWarrantyList(data) {
  return request({
    url: `/worker/warranty/list?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function workerWarrantyListExport(data, name) {
  return postBlob({
    url: '/worker/warranty/list/export',
    data,
    name
  })
}

export function workerWarrantyImport(data) {
  return handleImport('/worker/warranty/import', data.formdata, data.id || '')
}

export function workerWarrantyAdd(params) {
  return request({
    url: `/worker/warranty/add`,
    method: 'post',
    params
  })
}

export function workerWarrantyRefund(data) {
  return request({
    url: `/worker/warranty/refund`,
    method: 'post',
    data
  })
}

export function workerWarrantyDetail(params) {
  return request({
    url: `/worker/warranty/detail`,
    method: 'post',
    params
  })
}
