import http from "@/http/http";
import { CustomerParam, CustomerPaymentTypeParam } from "./paymentTypeModle";
enum Api {
    customerList = '/api/customerData/customerList',
    setPaymentType = '/api/customerData/setPaymentType',
    getPaymentType = '/api/customerData/getPaymentType',
    getCustomerByName = '/api/customerData/getCustomerByName'
}

/**
 * 客户信息列表接口
 * @param parms 
 * @returns 
 */
export const api_customerList = async (parms: CustomerParam) => {
    return await http.post(Api.customerList, parms)
}

/**
 * 客户设置支付方式
 * @param parms 
 * @returns 
 */
export const api_customerSetPaymentType = async (parms: CustomerPaymentTypeParam) => {
    return await http.post(Api.setPaymentType, parms)
}

/**
 * 客户支付方式加载
 * @param parms 
 * @returns 
 */
export const api_customerGetPaymentType = async (parms: Pick<CustomerPaymentTypeParam, "oldId">) => {
    return await http.post(Api.getPaymentType, parms)
}

/**
 * 根据客户名称获取客户编号
 * @param parms 
 * @returns 
 */
export const api_getCustomerByName = async (parms: Pick<CustomerPaymentTypeParam, "customerNameList">) => {
    return await http.post(Api.getCustomerByName, parms)
}