import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AccountVO, AccountForm, AccountQuery } from '@/api/settlement/accountSettlementAccounts/types';

/**
 * 查询患者账户信息列表
 * @param query
 * @returns {*}
 */

export const listAccount = (query?: AccountQuery): AxiosPromise<AccountVO[]> => {
  return request({
    url: '/settlement/accountSettleAccounts/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询患者账户信息详细
 * @param id
 */
export const getAccount = (id: string | number): AxiosPromise<AccountVO> => {
  return request({
    url: '/settlement/accountSettleAccounts/' + id,
    method: 'get'
  });
};

/**
 * 新增患者账户信息
 * @param data
 */
export const addAccount = (data: AccountForm) => {
  return request({
    url: '/settlement/accountSettleAccounts',
    method: 'post',
    data: data
  });
};

/**
 * 修改患者账户信息
 * @param data
 */
export const updateAccount = (data: AccountForm) => {
  return request({
    url: '/settlement/accountSettleAccounts',
    method: 'put',
    data: data
  });
};

/**
 * 删除患者账户信息
 * @param id
 */
export const delAccount = (id: string | number | Array<string | number>) => {
  return request({
    url: '/settlement/accountSettleAccounts/' + id,
    method: 'delete'
  });
};
