/**
 * KRA - Customer API Service (Example)
 */
import request from '@/utils/request';

export interface Customer {
  ID?: number;
  CreatedAt?: string;
  UpdatedAt?: string;
  customerName: string;
  customerPhoneData: string;
  sysUserID: number;
  sysUserAuthorityID: number;
  sysUser?: {
    userName: string;
    nickName: string;
  };
}

/** 创建客户 */
export const createExaCustomer = (data: Customer) => {
  return request.post('/customer/customer', data);
};

/** 更新客户 */
export const updateExaCustomer = (data: Customer) => {
  return request.put('/customer/customer', data);
};

/** 删除客户 */
export const deleteExaCustomer = (data: { ID: number }) => {
  return request.delete('/customer/customer', { data });
};

/** 获取单一客户信息 */
export const getExaCustomer = (params: { ID: number }) => {
  return request.get('/customer/customer', { params });
};

/** 获取客户列表 */
export const getExaCustomerList = (params: { page: number; pageSize: number }) => {
  return request.get('/customer/customerList', { params });
};

export default {
  createExaCustomer,
  updateExaCustomer,
  deleteExaCustomer,
  getExaCustomer,
  getExaCustomerList,
};
