import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/blade-transport/transport-vehicle/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    },
  });
};

export const getDetail = id => {
  return request({
    url: '/blade-transport/transport-vehicle/detail',
    method: 'get',
    params: {
      id,
    },
  });
};

export const submit = row => {
  return request({
    url: '/blade-transport/transport-vehicle/submit',
    method: 'post',
    data: row,
  });
};

export const remove = ids => {
  return request({
    url: '/blade-transport/transport-vehicle/remove',
    method: 'post',
    params: {
      ids,
    },
  });
};

export const changeStatus = (id, status) => {
  return request({
    url: '/blade-transport/transport-vehicle/status',
    method: 'post',
    params: {
      id,
      status,
    },
  });
};

export const auditCertification = (id, certificationStatus, rejectReason) => {
  return request({
    url: '/blade-transport/transport-vehicle/audit-certification',
    method: 'post',
    params: { id, certificationStatus, rejectReason },
  });
};

export const getExpiryStat = params => {
  return request({
    url: '/blade-transport/transport-vehicle/expiry-stat',
    method: 'get',
    params,
  });
};

export const recognitionTransportCertificates = objectKeys => {
  return request({
    url: '/blade-file/file/recognitionTransportCertificates',
    method: 'post',
    timeout: 60000,
    data: objectKeys,
  });
};
