service

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Budget

type Budget interface {
	GetDailyLimitByName(name string) int
	GetBaseDailyLimit() int
}

Budget service.

func NewBudget

func NewBudget(ctx context.Context, repo repository.Budget) Budget

NewBudget creates a new Budget instance.

type Category

type Category interface {
	GetAll() []*model.Category
	GetByName(name string) *model.Category
}

Category service.

func NewCategory

func NewCategory(ctx context.Context, repo repository.Category) (Category, error)

NewCategory creates a new Category instance.

type Expense

type Expense interface {
	GetAllByPeriod(period times.Period) int
	GetBaseByPeriod(period times.Period) int
	GetLastExpenses() ([]*model.Expense, error)
	AddExpense(rawMessage string) (*model.Expense, error)
	DeleteByID(id int) error
}

Expense service.

func NewExpense

func NewExpense(ctx context.Context, expenseRepo repository.Expense, category Category) Expense

NewExpense creates a new instance of Expense.

type Manager

type Manager struct {
	Category Category
	Budget   Budget
	Expense  Expense
}

Manager of services.

func NewManager

func NewManager(ctx context.Context, repo *repository.Repository) (*Manager, error)

NewManager creates a new Manager instance.

type Message

type Message struct {
	Amount       int    `regroup:"amount"`
	CategoryText string `regroup:"text"`
}

Message ...

Directories

Path Synopsis
Package mock_service is a generated GoMock package.
Package mock_service is a generated GoMock package.

Jump to

Keyboard shortcuts

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