import request from '/@/utils/request';
import type { AxiosPromise } from 'axios';
import type { IAdjustRecordSchemeHistory, IAdjustRecordSchemeHistoryList } from './types/index.type';
import type { ICommonListParams } from '../common.type';


/**
 * 添加透析单处方修改记录
 * @param data 
 * @returns 
 */
export function adjustRecordSchemeHistoryAddApi(data: Partial<IAdjustRecordSchemeHistory>) {
    return request({
        url: '/adjust/record/scheme/history/add',
		method: 'post',
        data
    })
}

/**
 * 批量添加透析单处方修改记录
 * @param data 
 * @returns 
 */
export function adjustRecordSchemeHistoryAddListApi(data: Partial<IAdjustRecordSchemeHistory>[]) {
    return request({
        url: '/adjust/record/scheme/history/addList',
		method: 'post',
        data
    })
}

/**
 * 删除透析单处方修改记录
 * @param id 
 * @returns 
 */
export function adjustRecordSchemeHistoryDelApi(id: number) {
    return request({
        url: '/adjust/record/scheme/history/delete',
		method: 'post',
        params: id
    })
}

/**
 * 批量删除透析单处方修改记录
 * @param id 
 * @returns 
 */
export function adjustRecordSchemeHistoryDelAllApi(ids: string) {
    return request({
        url: '/adjust/record/scheme/history/deleteAll',
		method: 'post',
        params: ids
    })
}

/**
 * 根据id获取透析单处方修改记录详情
 * @param id 
 * @returns 
 */
export function adjustRecordSchemeHistoryDetailByIdApi(id: number) {
    return request({
        url: '/adjust/record/scheme/history/detail',
		method: 'post',
        params: id
    })
}

/**
 * 根据code获取透析单处方修改记录详情
 * @param id 
 * @returns 
 */
export function adjustRecordSchemeHistoryDetailByCodeApi(code: string) {
    return request({
        url: '/adjust/record/scheme/history/detail2',
		method: 'post',
        params: code
    })
}

/**
 * 获取透析单处方修改记录列表
 * @param params 
 * @returns 
 */
export function adjustRecordSchemeHistoryListApi(params: ICommonListParams) :AxiosPromise<IAdjustRecordSchemeHistoryList> {
    return request({
        url: '/adjust/record/scheme/history/list',
		method: 'post',
        params,
    })
}

/**
 * 保存透析单处方修改记录
 * @param data 
 * @returns 
 */
export function adjustRecordSchemeHistorySaveApi(data: Partial<IAdjustRecordSchemeHistory>) {
    return request({
        url: '/adjust/record/scheme/history/save',
		method: 'post',
        data
    })
}

/**
 * 更新透析单处方修改记录
 * @param data 
 * @returns 
 */
export function adjustRecordSchemeHistoryUpdateApi(data: Partial<IAdjustRecordSchemeHistory>) {
    return request({
        url: '/adjust/record/scheme/history/update',
		method: 'post',
        data
    })
}