transactions

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

templ: version: v0.2.513

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	Create(ctx context.Context, transaction *models.Transaction) error
	Update(ctx context.Context, transaction *models.Transaction) error
	List(ctx context.Context, req *models.TransactionsListRequest) ([]*models.Transaction, int, error)
	Delete(ctx context.Context, id int) error
}

type RepositoryImpl

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

func NewRepository

func NewRepository(db *sqlx.DB) *RepositoryImpl

func (*RepositoryImpl) Create

func (t *RepositoryImpl) Create(ctx context.Context, transaction *models.Transaction) error

func (*RepositoryImpl) Delete

func (t *RepositoryImpl) Delete(ctx context.Context, id int) error

func (*RepositoryImpl) List

func (*RepositoryImpl) Update

func (t *RepositoryImpl) Update(ctx context.Context, transaction *models.Transaction) error

type TagsRepository

type TagsRepository interface {
	List(ctx context.Context, walletId int) ([]*models.Tag, error)
	Get(ctx context.Context, tagId int) (*models.Tag, error)
	GetIds(ctx context.Context, tagIds []int) ([]*models.Tag, error)
}

type Transactions

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

func New

func New(
	repository Repository,
	tagsRepository TagsRepository,
	walletRepository WalletRepository,
	log *slog.Logger,
) *Transactions

func (*Transactions) ExpandTags

func (t *Transactions) ExpandTags(ctx context.Context, transactions []*models.Transaction) error

func (*Transactions) Mount

func (t *Transactions) Mount(router chi.Router)

type WalletRepository

type WalletRepository interface {
	ForUser(ctx context.Context, userId int) ([]*models.Wallet, error)
	HasPermission(ctx context.Context, walletId, userId int) (bool, error)
}

Jump to

Keyboard shortcuts

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