import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AuthenticityVerificationVO, AuthenticityVerificationForm, AuthenticityVerificationQuery } from '@/api/customer/authenticityVerification/types';

/**
 * 查询客户真实性验真记录列表
 * @param query
 * @returns {*}
 */

export const listAuthenticityVerification = (query?: AuthenticityVerificationQuery): AxiosPromise<AuthenticityVerificationVO[]> => {
  return request({
    url: '/customer/authenticityVerification/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询客户真实性验真记录详细
 * @param verificationId
 */
export const getAuthenticityVerification = (verificationId: string | number): AxiosPromise<AuthenticityVerificationVO> => {
  return request({
    url: '/customer/authenticityVerification/' + verificationId,
    method: 'get'
  });
};

/**
 * 新增客户真实性验真记录
 * @param data
 */
export const addAuthenticityVerification = (data: AuthenticityVerificationForm) => {
  return request({
    url: '/customer/authenticityVerification',
    method: 'post',
    data: data
  });
};

/**
 * 修改客户真实性验真记录
 * @param data
 */
export const updateAuthenticityVerification = (data: AuthenticityVerificationForm) => {
  return request({
    url: '/customer/authenticityVerification',
    method: 'put',
    data: data
  });
};

/**
 * 删除客户真实性验真记录
 * @param verificationId
 */
export const delAuthenticityVerification = (verificationId: string | number | Array<string | number>) => {
  return request({
    url: '/customer/authenticityVerification/' + verificationId,
    method: 'delete'
  });
};
