import request from '@/utils/request';
import { InvoiceTypeVO, InvoiceTypeQuery, InvoiceTypeForm } from './types';

/**
 * 查询发票类型列表
 */
export function listInvoiceType(query: InvoiceTypeQuery) {
  return request<any>({
    url: '/system/invoiceType/list',
    method: 'get',
    params: query
  });
}

/**
 * 查询发票类型详细
 */
export function getInvoiceType(id: string | number) {
  return request<any>({
    url: '/system/invoiceType/' + id,
    method: 'get'
  });
}

/**
 * 新增发票类型
 */
export function addInvoiceType(data: InvoiceTypeForm) {
  return request<any>({
    url: '/system/invoiceType',
    method: 'post',
    data: data
  });
}

/**
 * 修改发票类型
 */
export function updateInvoiceType(data: InvoiceTypeForm) {
  return request<any>({
    url: '/system/invoiceType',
    method: 'put',
    data: data
  });
}

/**
 * 删除发票类型
 */
export function delInvoiceType(id: string | number | Array<string | number>) {
  return request<any>({
    url: '/system/invoiceType/' + id,
    method: 'delete'
  });
}
