import http from "@/http/http";
import { ProductRateRatioId, ProductRateRatioDto, ProductRateRatioParam } from "./apiProductRateRatioModel";

enum Api {
    productRateRatioList = '/api/productRateRatio/list',//产品费率查询
    ratioRecordList = '/api/productRateRatio/ratioRecordList',//产品费率记录查询
    add = '/api/productRateRatio/add',//产品费率添加
    edit = '/api/productRateRatio/edit',//产品费率编辑
    delete = '/api/productRateRatio',//产品费率删除
    reGet = '/api/productRateRatio/reGet',//获取产品费率记录
    changeState = '/api/productRateRatio/changeState',//费率停用、启用
}

//产品费率查询
export const api_ProductRateRatioList = async (parms: ProductRateRatioParam) => {
    return await http.post(Api.productRateRatioList, parms)
}

// 产品费率记录查询
export const api_RatioRecordList = async (parms: ProductRateRatioParam) => {
    return await http.post(Api.ratioRecordList, parms)
}

//产品费率新增
export const api_ProductRateRatioAdd = async (parms: ProductRateRatioDto) => {
    return await http.post(Api.add, parms)
}

//产品费率编辑
export const api_ProductRateRatioEdit = async (parms: ProductRateRatioDto) => {
    return await http.put(Api.edit, parms)
}

//产品费率删除
export const api_ProductRateRatioDelete = async (parms: ProductRateRatioId) => {
    return await http.delete(Api.delete, parms)
}

/**
 * 获取产品费率记录
 */
export const api_ProductRateRatioReGet = async (parms: ProductRateRatioId) => {
    return await http.getRestApi(Api.reGet, parms)
}

/**
 * 费率停用、启用
 */
export const api_ProductRateRatioChangeState = async (parms: ProductRateRatioParam) => {
    return await http.post(Api.changeState, parms)
}