repository

package
v0.0.0-...-0fb1e89 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatQuery

func FormatQuery(q string) string

func HandlerError

func HandlerError(tx pgx.Tx, err error) error

Types

type Account

type Account struct {
	client.Client
}

func (*Account) Create

func (r *Account) Create(tx pgx.Tx, accountId uint, balance float64, accountType string) error

func (*Account) FindById

func (r *Account) FindById(accountId uint) (entity.Account, error)

func (*Account) FindByType

func (r *Account) FindByType(accType string) (entity.Account, error)

func (*Account) Update

func (r *Account) Update(tx pgx.Tx, account entity.Account) error

type Order

type Order struct {
	client.Client
}

func (*Order) Create

func (r *Order) Create(tx pgx.Tx, order entity.Order) error

func (*Order) FindById

func (r *Order) FindById(id uint) (order entity.Order, err error)

func (*Order) GetDataForReport

func (r *Order) GetDataForReport(year uint, month uint) (result [][]string, err error)

func (*Order) UpdateStatus

func (r *Order) UpdateStatus(tx pgx.Tx, id uint, status string) (err error)

type Repository

type Repository struct {
	Account
	Order
	Service
	Transaction
}

func GetRepository

func GetRepository(client *pgxpool.Pool) Repository

type Service

type Service struct {
	client.Client
}

func (*Service) FindAll

func (r *Service) FindAll() (service []entity.Service, err error)

func (*Service) FindById

func (r *Service) FindById(id uint) (service entity.Service, err error)

type Transaction

type Transaction struct {
	client.Client
}

func (*Transaction) Create

func (r *Transaction) Create(tx pgx.Tx, model entity.Transaction) error

func (*Transaction) FindByAccountIdUsingStatements

func (r *Transaction) FindByAccountIdUsingStatements(accountId uint, query url.Values) (trans []entity.TransactionPagination, err error)

Jump to

Keyboard shortcuts

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