import { baseRequest } from '@/utils/request'

const request = (url, ...arg) => baseRequest(`/biz/consumptionrecord/` + url, ...arg)

/**
 * 消费记录Api接口管理器
 *
 * @author fanzherong
 * @date  2025/02/06 08:56
 **/
export default {
	// 获取消费记录分页
	consumptionRecordPage(data) {
		return request('page', data, 'get')
	},
	// 提交消费记录表单 edit为true时为编辑，默认为新增
	consumptionRecordSubmitForm(data, edit = false) {
		return request(edit ? 'edit' : 'add', data)
	},
	// 删除消费记录
	consumptionRecordDelete(data) {
		return request('delete', data)
	},
	// 获取消费记录详情
	consumptionRecordDetail(data) {
		return request('detail', data, 'get')
	},
	// 获取消费金额统计
	queryRecordTotal(data){
		return request('queryRecordTotal',data,'get')
	},
	queryRechargeTotal(data){
		return request('queryRechargeTotal',data,'get')
	},
	//获取账户余额&会员数统计
	queryBalanceTotal(data){
		return request('queryBalanceTotal',data,'get')
	},
	//近七日消费金额和订单数折线图
	queryConsumptionChart(data){
		return request('queryConsumptionChart',data,'get')
	},
	queryRechargeChar(data){
		return request('queryRechargeChar',data,'get')
	},
	queryEachStore(data){
		return request('queryEachStore',data,'get')
	},
	//导出
	exportRecord(data){
		return request('exportRecord', data, 'get', {
			responseType: 'blob'
		})
	},
	warnPage(data){
		return request('warnPage',data,'get')
	}
}
