import request from '@/utils/request';
import { PurchaseHabit } from './types';
/**
 * 查询发票信息详情
 */
export function getInvoiceInfo(id: number) {
  return request({
    url: `/customer/enterprise/invoice/${id}`,
    method: 'get'
  });
}

/**
 * 新增客户采购习惯
 * @param data
 */
export const addPurchaseHabit = (data: PurchaseHabit) => {
  return request({
    url: '/customer/purchaseHabit',
    method: 'post',
    data: data
  });
};

/**
 * 修改客户采购习惯
 * @param data
 */
export const updatePurchaseHabit = (data: PurchaseHabit) => {
  return request({
    url: '/customer/pcPurchaseHabit',
    method: 'put',
    data: data
  });
};

/**
 * 删除客户采购习惯
 * @param id
 */
export const delPurchaseHabit = (id: string | number | Array<string | number>) => {
  return request({
    url: '/customer/pcPurchaseHabit/' + id,
    method: 'delete'
  });
};

/**
 * 新增客户采购习惯
 * @param data
 */
export const getCustomerPurchaseHabitData = () => {
  return request({
    url: '/customer/pcPurchaseHabit/getCustomerPurchaseHabitData',
    method: 'get'
  });
};
