/**
 * 应收模版-API
 */
import http from "@/http/http";
import { ActiveParams, Idparams } from "../base/BaseDataModel";
import { CustomerFeeProductIdParams, ReceivableModelDto, ReceivableParams } from "./receivableModel";

enum Api {
    receivableModelList = '/api/receivableModel/list',
    getReceivableModelByPId = '/api/receivableModel/getReceivableModelByPId',
    add = '/api/receivableModel/add',
    edit = '/api/receivableModel/edit',
    delete = '/api/receivableModel',
    customerFeeProductIdList = 'api/customerFeeProductId/list',
    active = '/api/receivableModel/active',
}

/**
 * 应收模版查询列表
 * @param parms 
 * @returns 
 */
export const api_receivableModelList = async (parms: ReceivableParams) => {
    return await http.post(Api.receivableModelList, parms)
}

/**
 * 根据单号查询
 * @param parms 
 * @returns 
 */
export const api_getReceivableModelByPId = async (parms: Idparams) => {
    return await http.get(Api.getReceivableModelByPId, parms)
}

/**
 * 新增应收模版
 * @param parms 
 * @returns 
 */
export const api_addCostFeeItemSet = async (parms: ReceivableModelDto) => {
    return await http.post(Api.add, parms)
}

/**
 * 根据搜索的产品搜索费用
 * @returns 
 */
export const api_customerFeeProductIdList = async (param: CustomerFeeProductIdParams) => {
    return await http.post(Api.customerFeeProductIdList, param)
}

/**
 * 编辑应收模版
 * @param parms 
 * @returns 
 */
export const api_editReceivableModel = async (parms: ReceivableModelDto) => {
    return await http.post(Api.edit, parms)
}

/**
 * 删除应收模版
 * @param parms 
 * @returns 
 */
export const api_deleteReceivableModel = async (parms: Idparams) => {
    return await http.delete(Api.delete, parms)
}

/**
 * 应收模版是否激活
 * @param parms 
 * @returns 
 */
export const api_receivableModelActive = async (parms: ActiveParams) => {
    return await http.post(Api.active, parms)
}
