dao

package
v0.0.0-...-ae6f334 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ASC  = "ASC"
	DESC = "DESC"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryDAO

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

func NewCategoryDAO

func NewCategoryDAO(db *pgxpool.Pool) CategoryDAO

func (CategoryDAO) FindAll

func (dao CategoryDAO) FindAll(ctx context.Context) ([]*entity.Category, error)

func (CategoryDAO) FindByTransactionTypeId

func (dao CategoryDAO) FindByTransactionTypeId(ctx context.Context, transactionTypeId int) ([]*entity.Category, error)

func (CategoryDAO) GetById

func (dao CategoryDAO) GetById(ctx context.Context, id int) (entity.Category, error)

type MessageContextDAO

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

func NewMessageContextDao

func NewMessageContextDao(db *pgxpool.Pool) MessageContextDAO

func (MessageContextDAO) DeleteById

func (dao MessageContextDAO) DeleteById(ctx context.Context, id int) error

func (MessageContextDAO) GetById

func (dao MessageContextDAO) GetById(ctx context.Context, id int) (*entity.MessageContext, error)

func (MessageContextDAO) Insert

func (dao MessageContextDAO) Insert(ctx context.Context, messageContext entity.MessageContext) (int, error)

type StatDAO

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

func NewStatDAO

func NewStatDAO(db *pgxpool.Pool) StatDAO

func (StatDAO) GetMonthly

func (dao StatDAO) GetMonthly(ctx context.Context, from util.YearMonth, to util.YearMonth, userId int64) ([]*entity.MonthlySummary, error)

type TransactionDAO

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

func NewTransactionDao

func NewTransactionDao(db *pgxpool.Pool) TransactionDAO

func (TransactionDAO) CountListByMonthAndYear

func (dao TransactionDAO) CountListByMonthAndYear(ctx context.Context, dateFrom time.Time, dateTo time.Time, userId int64) (int, error)

func (TransactionDAO) DeleteById

func (dao TransactionDAO) DeleteById(ctx context.Context, id int, userId int64) error

func (TransactionDAO) FindLatestByUserId

func (dao TransactionDAO) FindLatestByUserId(ctx context.Context, userId int64) (*entity.Transaction, error)

func (TransactionDAO) GetBreakdownByCategory

func (dao TransactionDAO) GetBreakdownByCategory(ctx context.Context, dateFrom time.Time, dateTo time.Time, userId int64) ([]entity.TransactionBreakdown, error)

func (TransactionDAO) GetById

func (dao TransactionDAO) GetById(ctx context.Context, id int, userId int64) (entity.Transaction, error)

func (TransactionDAO) Insert

func (dao TransactionDAO) Insert(ctx context.Context, transaction entity.Transaction) error

func (TransactionDAO) ListByMonthAndYear

func (dao TransactionDAO) ListByMonthAndYear(ctx context.Context, dateFrom time.Time, dateTo time.Time, offset int, limit int, isAsc bool, userId int64) ([]entity.Transaction, error)

type TransactionTypeDAO

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

func NewTransactionTypeDAO

func NewTransactionTypeDAO(db *pgxpool.Pool) TransactionTypeDAO

func (TransactionTypeDAO) GetAll

func (TransactionTypeDAO) GetById

type UserDAO

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

func NewUserDao

func NewUserDao(db *pgxpool.Pool) UserDAO

func (UserDAO) FindUserById

func (dao UserDAO) FindUserById(ctx context.Context, id int64) (*entity.User, error)

func (UserDAO) Insert

func (dao UserDAO) Insert(ctx context.Context, user entity.User) error

Jump to

Keyboard shortcuts

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