/**
 * 成本费用设置-API
 */
import http from "@/http/http";
import { ListByParentId, SubmitCostFeeSetModel, CostFeeSetParams, ActiveParams, CostFeeSetCopy, CostFeeQueryParam } from "./costFeeSetModel";

enum Api {
    costFeeSetList = '/api/costFeeSet/list',
    getCostFeeSetByPId = '/api/costFeeSet/getCostFeeSetByPId',
    add = '/api/costFeeSet/add',
    edit = '/api/costFeeSet/edit',
    delete = '/api/costFeeSet',
    active = '/api/costFeeSet/active',
    costFeeSetCopy = '/api/costFeeSet/copy',
    listByParentId = '/api/costFeeSet/listByParentId',
    costFeeQuery = '/api/CostFee/costFeeQuery'
}

/**
 * 查询成本费用设置列表
 * @returns 
 */
export const api_costFeeSetList = async (parms: CostFeeSetParams) => {
    return await http.post(Api.costFeeSetList, parms)
}

/**
 * 根据ID查找费用
 * @returns 
 */
export const api_costFeeSetListById = async (parms: Pick<ListByParentId, "id">) => {
    return await http.post(Api.getCostFeeSetByPId, parms)
}

/**
 * 新增
 * @returns 
 */
export const api_costFeeSetAdd = async (parms: SubmitCostFeeSetModel) => {
    return await http.post(Api.add, parms)
}

/**
 * 编辑
 * @returns 
 */
export const api_costFeeSetEdit = async (parms: SubmitCostFeeSetModel) => {
    return await http.post(Api.edit, parms)
}

/**
 * 删除
 * @returns 
 */
export const api_costFeeSetDelete = async (parms: Recordable) => {
    return await http.delete(Api.delete, parms)
}

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

/**
 * 客户费用拷贝
 */
export const api_costFeeSetCopy = async (parms: CostFeeSetCopy) => {
    return await http.post(Api.costFeeSetCopy, parms)
}

/**
 * 根据父ID查询价格设置
 * @returns 
 */
export const api_costFeeSetParentIdListApi = async (parms: ListByParentId) => {
    return await http.get(Api.listByParentId, parms)
}

/**
 * 查看客户费用设置查询
 * @returns 
 */
export const api_costFee_costFeeQuery = async (parms: CostFeeQueryParam) => {
    return await http.post(Api.costFeeQuery, parms)
}
