units

package
v0.0.0-...-4d895cd Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPayloadCheckFailed = errors.New("payload check failed")
)

Functions

This section is empty.

Types

type AccountService

type AccountService interface {
	CalculateBalances(ctx context.Context, chunk []entities.Transaction) (map[uint64]entities.Account, error)
}

type AccountsRepository

type AccountsRepository interface {
	ButchUpdate(ctx context.Context, accounts []entities.Account) error
}

type BalanceCalculator

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

func NewBalanceCalculator

func NewBalanceCalculator(accountService AccountService) *BalanceCalculator

func (*BalanceCalculator) GetName

func (u *BalanceCalculator) GetName() string

func (*BalanceCalculator) Handle

func (u *BalanceCalculator) Handle(ctx context.Context, request *Request, payload *Payload) (*Payload, error)

type ErrorUnitPanic

type ErrorUnitPanic string

func (ErrorUnitPanic) Error

func (e ErrorUnitPanic) Error() string

type InvoicesChecker

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

func NewInvoicesChecker

func NewInvoicesChecker(repo InvoicesRepository) *InvoicesChecker

func (*InvoicesChecker) GetName

func (u *InvoicesChecker) GetName() string

func (*InvoicesChecker) Handle

func (u *InvoicesChecker) Handle(ctx context.Context, request *Request, payload *Payload) (*Payload, error)

type InvoicesRepository

type InvoicesRepository interface {
	GetAllByPeriodID(periodID uint64) ([]entities.Invoice, error)
}

type Payload

type Payload struct {
	ActivePeriod *entities.Period
	Transactions []entities.Transaction
	Accounts     []entities.Account
}

func NewPayload

func NewPayload() *Payload

type PeriodExtender

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

func NewPeriodExtender

func NewPeriodExtender(repo PeriodsRepository) *PeriodExtender

func (*PeriodExtender) GetName

func (u *PeriodExtender) GetName() string

func (*PeriodExtender) Handle

func (u *PeriodExtender) Handle(ctx context.Context, request *Request, payload *Payload) (*Payload, error)

type PeriodsRepository

type PeriodsRepository interface {
	Update(ctx context.Context, period *entities.Period) error
	GetLast(ctx context.Context) (*entities.Period, error)
	Create(ctx context.Context) (*entities.Period, error)
}

type Request

type Request struct {
}

type ResultSaver

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

func NewResultSaver

func NewResultSaver(accountsRepo AccountsRepository, periodsRepo PeriodsRepository) *ResultSaver

func (*ResultSaver) GetName

func (u *ResultSaver) GetName() string

func (*ResultSaver) Handle

func (u *ResultSaver) Handle(ctx context.Context, _ *Request, payload *Payload) (*Payload, error)

type TransactionsExtender

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

func NewTransactionsExtender

func NewTransactionsExtender(repo TransactionsRepository) *TransactionsExtender

func (*TransactionsExtender) GetName

func (u *TransactionsExtender) GetName() string

func (*TransactionsExtender) Handle

func (u *TransactionsExtender) Handle(ctx context.Context, request *Request, payload *Payload) (*Payload, error)

type TransactionsRepository

type TransactionsRepository interface {
	GetAllByPeriodID(periodID uint64) ([]entities.Transaction, error)
}

type Transactor

type Transactor interface {
	Transaction(ctx context.Context, fn func(ctx context.Context) error) error
}

type Unit

type Unit interface {
	GetName() string
	Handle(ctx context.Context, request *Request, payload *Payload) (*Payload, error)
}

Jump to

Keyboard shortcuts

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