// ================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================

package service

import (
	"context"
	"kami/internal/model"
	"kami/internal/model/entity"

	"github.com/gogf/gf/v2/database/gdb"
)

type (
	ISysUserPayment interface {
		// AddDeductionRecord 添加预扣款记录
		AddDeductionRecord(ctx context.Context, input *model.AddDeductionRecordInput, tx gdb.TX) (err error)
		// DeductionSuccess 扣款(交易)成功
		DeductionSuccess(ctx context.Context, input *model.AddDeductionRecordInput, tx gdb.TX) (err error)
		// DeductionReturn 扣款(交易)失败
		DeductionReturn(ctx context.Context, input *model.AddDeductionRecordInput, tx gdb.TX) (err error)
		// Deduction 用户钱包预扣款
		Deduction(ctx context.Context, input *model.DeductionInput, tx gdb.TX) (err error)
		// AddRecord 添加充值流水记录
		AddRecord(ctx context.Context, input model.SysUserPaymentRecordInput, tx gdb.TX) (recordId int64, err error)
		ListRecords(ctx context.Context, input model.SysUserRecordListInput) (total int, list []*entity.V1SysUserPaymentRecords, err error)
		DailySummary(ctx context.Context, input model.SysUserPaymentDailySummaryInput) (total int, record []*model.SysUserRecord, err error)
		// GetNextUser 切换账户
		GetNextUser(ctx context.Context, amount float64, currentUserId string, tx gdb.TX)
		// Add 往钱包中添加当前用户数据
		Add(ctx context.Context, input model.SysUserPaymentInput, tx gdb.TX) (err error)
		// Recharge 往钱包内充值
		Recharge(ctx context.Context, input model.SysUserPaymentRechargeOrConsumeInput, tx gdb.TX) (recordId int64, err error)
		// Consumption 消耗金额
		Consumption(ctx context.Context, input *model.SysUserPaymentRechargeOrConsumeInput, tx gdb.TX) (recordId int64, err error)
		// CheckBalanceEnough 查询钱包内钱是不是够充值
		CheckBalanceEnough(ctx context.Context, input *model.SysUserPaymentCheckBalanceInput) (isEnough bool, err error)
		// CheckAmountEnough 查询钱包内钱是不是够充值
		CheckAmountEnough(ctx context.Context, input *model.SysUserPaymentCheckBalanceInput) (isEnough bool, err error)
		// Edit 修改数据
		Edit(ctx context.Context, input model.SysUserPaymentInput, tx gdb.TX) (err error)
		// List 查询钱包列表
		List(ctx context.Context, input model.SysUserPaymentListInput) (total int, list []*entity.V1SysUserPayment, err error)
		// GetDetailById 查询单个用户的钱包信息
		GetDetailById(ctx context.Context, input *model.SysUserPaymentGetOneInput) (res *entity.V1SysUserPayment, err error)
		// Delete 删除钱包信息
		Delete(ctx context.Context, input model.SysUserPaymentDeleteInput, tx gdb.TX) (err error)
		// GetAllByMinAmount 获取所有金额在minAmount以上的钱包
		GetAllByMinAmount(ctx context.Context, minAmount float64, tx gdb.TX) (list []*entity.V1SysUserPayment, err error)
	}
)

var (
	localSysUserPayment ISysUserPayment
)

func SysUserPayment() ISysUserPayment {
	if localSysUserPayment == nil {
		panic("implement not found for interface ISysUserPayment, forgot register?")
	}
	return localSysUserPayment
}

func RegisterSysUserPayment(i ISysUserPayment) {
	localSysUserPayment = i
}
