wallet

package
v1.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package wallet implements the user-facing wallet subdomain of the billing module: commission withdrawal, balance/commission statements and the affiliate earnings overview. Only the module facade may reach it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type AffiliateReader

type AffiliateReader interface {
	CountAffiliates(ctx context.Context, refererId int64) (int64, error)
	QueryAffiliateList(ctx context.Context, refererId int64, page, size int) ([]*user.User, int64, error)
}

AffiliateReader is the read-only port onto the identity domain's referral relations; the legacy user repository satisfies it structurally. The commission amounts belong to billing, the referral tree stays with identity.

type AuthMethodReader

type AuthMethodReader interface {
	FindUserAuthMethods(ctx context.Context, userId int64) ([]*user.AuthMethods, error)
}

AuthMethodReader is the read-only identity port used to render an affiliate's masked login identifier.

type CommissionWithdrawLogic

type CommissionWithdrawLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*CommissionWithdrawLogic) CommissionWithdraw

func (l *CommissionWithdrawLogic) CommissionWithdraw(req *dto.CommissionWithdrawRequest) (resp *dto.WithdrawalLog, err error)

type Deps

type Deps struct {
	Logs        repository.LogRepo
	Cache       repository.UserCacheRepo
	Affiliates  AffiliateReader
	AuthMethods AuthMethodReader
	Tx          Transactor
}

Deps declares the subdomain's dependencies; the module facade forwards them from the composition root.

type QueryUserAffiliateListLogic

type QueryUserAffiliateListLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*QueryUserAffiliateListLogic) QueryUserAffiliateList

type QueryUserAffiliateLogic

type QueryUserAffiliateLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*QueryUserAffiliateLogic) QueryUserAffiliate

func (l *QueryUserAffiliateLogic) QueryUserAffiliate() (resp *dto.QueryUserAffiliateCountResponse, err error)

type QueryUserBalanceLogLogic

type QueryUserBalanceLogLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*QueryUserBalanceLogLogic) QueryUserBalanceLog

func (l *QueryUserBalanceLogLogic) QueryUserBalanceLog() (resp *dto.QueryUserBalanceLogListResponse, err error)

type QueryUserCommissionLogLogic

type QueryUserCommissionLogLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*QueryUserCommissionLogLogic) QueryUserCommissionLog

type QueryWithdrawalLogLogic

type QueryWithdrawalLogLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*QueryWithdrawalLogLogic) QueryWithdrawalLog

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the wallet subdomain entry point used by the billing facade.

func NewService

func NewService(deps Deps) *Service

func (*Service) CommissionWithdraw

func (s *Service) CommissionWithdraw(ctx context.Context, req *dto.CommissionWithdrawRequest) (*dto.WithdrawalLog, error)

func (*Service) QueryUserAffiliate

func (s *Service) QueryUserAffiliate(ctx context.Context) (*dto.QueryUserAffiliateCountResponse, error)

func (*Service) QueryUserBalanceLog

func (s *Service) QueryUserBalanceLog(ctx context.Context) (*dto.QueryUserBalanceLogListResponse, error)

type Transactor

type Transactor interface {
	InBillingTx(ctx context.Context, fn func(repository.BillingStore) error) error
}

Transactor mirrors the facade's billing-scoped transaction port.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL