import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { XfInorouttypeVO, XfInorouttypeForm, XfInorouttypeQuery } from '@/api/basics/basicParameter/xfInorouttype/types';

/**
 * 查询收支类型列表
 * @param query
 * @returns {*}
 */
export const listXfInorouttype = (query?: XfInorouttypeQuery): AxiosPromise<XfInorouttypeVO[]> => {
  return request({
    url: '/backstage/basicParameter/xfInorouttype/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询收支类型详细
 * @param typeId
 */
export const getXfInorouttype = (typeId: string | number): AxiosPromise<XfInorouttypeVO> => {
  return request({
    url: '/backstage/basicParameter/xfInorouttype/' + typeId,
    method: 'get'
  });
};

/**
 * 新增收支类型
 * @param data
 */
export const addXfInorouttype = (data: XfInorouttypeForm) => {
  return request({
    url: '/backstage/basicParameter/xfInorouttype',
    method: 'post',
    data: data
  });
};

/**
 * 修改收支类型
 * @param data
 */
export const updateXfInorouttype = (data: XfInorouttypeForm) => {
  return request({
    url: '/backstage/basicParameter/xfInorouttype',
    method: 'put',
    data: data
  });
};

/**
 * 删除收支类型
 * @param typeId
 */
export const delXfInorouttype = (typeId: string | number | Array<string | number>) => {
  return request({
    url: '/backstage/basicParameter/xfInorouttype/' + typeId,
    method: 'delete'
  });
};
