repository

package
v0.0.0-...-d1da606 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WalletRepositoryDB

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

func (*WalletRepositoryDB) AddTransaction

func (wr *WalletRepositoryDB) AddTransaction(ctx context.Context, transaction models.Transaction) error

func (*WalletRepositoryDB) Create

func (wr *WalletRepositoryDB) Create(ctx context.Context, userID int) error

func (*WalletRepositoryDB) GetByID

func (wr *WalletRepositoryDB) GetByID(ctx context.Context, userID int) (models.Wallet, error)

func (*WalletRepositoryDB) ListTransactionsByUser

func (wr *WalletRepositoryDB) ListTransactionsByUser(ctx context.Context, userID int) ([]models.Transaction, error)

func (*WalletRepositoryDB) Update

func (wr *WalletRepositoryDB) Update(ctx context.Context, userID int, amount float64) error

type WalleterRepository

type WalleterRepository interface {
	Create(ctx context.Context, userID int) error
	GetByID(ctx context.Context, userID int) (models.Wallet, error)
	Update(ctx context.Context, userID int, amount float64) error
	AddTransaction(ctx context.Context, transaction models.Transaction) error
	ListTransactionsByUser(ctx context.Context, userID int) ([]models.Transaction, error)
}

func NewWalletRepositoryDB

func NewWalletRepositoryDB(db *sqlx.DB) WalleterRepository

Jump to

Keyboard shortcuts

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