import request from '/@/utils/request';
import type { IPatientYibaoLimitControlSaveConfigParams, IGetPatientYibaoLimitControlConfigParams, IPatientYibaoLimitControlConfig, IGetPatientYibaoLimitControlCalculateTheAmountParams } from './types/index.type';
import type { AxiosPromise } from 'axios';

/**
 * 保存患者医保限额设置API
 * @param data 
 * @returns 
 */
export function patientYibaoLimitControlSaveConfigApi(params: IPatientYibaoLimitControlSaveConfigParams) {
    return request({
        url: '/patient/yibao/limit/control/saveConfig',
        method: 'post',
        params
    })
}

/**
 * 获取患者医保限额设置API
 * @param params 
 * @returns 
 */
export function getPatientYibaoLimitControlConfigApi(params: IGetPatientYibaoLimitControlConfigParams): AxiosPromise<IPatientYibaoLimitControlConfig[]> {
    return request({
        url: '/patient/yibao/limit/control/getConfig',
        method: 'post',
        params
    })
}

/**
 * 删除患者医保限额设置API
 * @param id 
 * @returns 
 */
export function getPatientYibaoLimitControlConfigDelApi(id: number) {
    return request({
        url: '/patient/yibao/limit/control/delete',
        method: 'post',
        params: { id }
    })
}

/**
 * 获取患者医保余额API
 * @param params 
 * @returns 
 */
export function getPatientYibaoLimitControlCalculateTheAmountApi(params: IGetPatientYibaoLimitControlCalculateTheAmountParams) :AxiosPromise<{[key: string]: any}> {
    return request({
        url: '/patient/yibao/limit/control/calculateTheAmount',
        method: 'post',
        params
    })
}