import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StatementDetailVO, StatementDetailForm, StatementDetailQuery } from '@/api/bill/statementDetail/types';

/**
 * 查询对账单交易明细列表
 * @param query
 * @returns {*}
 */

export const listStatementDetail = (query?: StatementDetailQuery): AxiosPromise<StatementDetailVO[]> => {
  return request({
    url: '/bill/statementDetail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询对账单交易明细详细
 * @param id
 */
export const getStatementDetail = (id: string | number): AxiosPromise<StatementDetailVO> => {
  return request({
    url: '/bill/statementDetail/' + id,
    method: 'get'
  });
};

/**
 * 新增对账单交易明细
 * @param data
 */
export const addStatementDetail = (data: StatementDetailForm) => {
  return request({
    url: '/bill/statementDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改对账单交易明细
 * @param data
 */
export const updateStatementDetail = (data: StatementDetailForm) => {
  return request({
    url: '/bill/statementDetail',
    method: 'put',
    data: data
  });
};

/**
 * 删除对账单交易明细
 * @param id
 */
export const delStatementDetail = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bill/statementDetail/' + id,
    method: 'delete'
  });
};
