specification

package
v0.0.0-...-11b1c05 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoTests

func DoTests(t *testing.T, interactor Interactor)

Types

type AccountOpts

type AccountOpts struct {
	OffBudget bool
}

type CategoryGroupOpts

type CategoryGroupOpts struct {
}

type CategoryOpts

type CategoryOpts struct {
	Group beans.CategoryGroup
}

type Context

type Context struct {
	SessionID beans.SessionID
	BudgetID  beans.ID
}

Common parameters that need to be passed on most requests.

type Interactor

type Interactor interface {
	// Account
	AccountCreate(t *testing.T, ctx Context, params beans.AccountCreate) (beans.ID, error)
	AccountList(t *testing.T, ctx Context) ([]beans.AccountWithBalance, error)
	AccountListTransactable(t *testing.T, ctx Context) ([]beans.Account, error)
	AccountGet(t *testing.T, ctx Context, id beans.ID) (beans.Account, error)

	// Budget
	BudgetCreate(t *testing.T, ctx Context, name beans.Name) (beans.ID, error)
	BudgetGet(t *testing.T, ctx Context, id beans.ID) (beans.Budget, error)
	BudgetGetAll(t *testing.T, ctx Context) ([]beans.Budget, error)

	// Category
	CategoryCreate(t *testing.T, ctx Context, groupID beans.ID, name beans.Name) (beans.ID, error)
	CategoryGet(t *testing.T, ctx Context, id beans.ID) (beans.Category, error)

	CategoryGroupCreate(t *testing.T, ctx Context, name beans.Name) (beans.ID, error)
	CategoryGroupGet(t *testing.T, ctx Context, id beans.ID) (beans.CategoryGroupWithCategories, error)

	CategoryGetAll(t *testing.T, ctx Context) ([]beans.CategoryGroupWithCategories, error)

	// Month
	MonthGetOrCreate(t *testing.T, ctx Context, date beans.MonthDate) (beans.MonthWithDetails, error)
	MonthUpdate(t *testing.T, ctx Context, monthID beans.ID, carryover beans.Amount) error
	MonthSetCategoryAmount(t *testing.T, ctx Context, monthID beans.ID, categoryID beans.ID, amount beans.Amount) error

	// Payee
	PayeeCreate(t *testing.T, ctx Context, name beans.Name) (beans.ID, error)
	PayeeGetAll(t *testing.T, ctx Context) ([]beans.Payee, error)
	PayeeGet(t *testing.T, ctx Context, id beans.ID) (beans.Payee, error)

	// Transaction
	TransactionCreate(t *testing.T, ctx Context, params beans.TransactionCreateParams) (beans.ID, error)
	TransactionGet(t *testing.T, ctx Context, id beans.ID) (beans.TransactionWithRelations, error)
	TransactionUpdate(t *testing.T, ctx Context, params beans.TransactionUpdateParams) error
	TransactionDelete(t *testing.T, ctx Context, ids []beans.ID) error
	TransactionGetAll(t *testing.T, ctx Context) ([]beans.TransactionWithRelations, error)
	TransactionGetSplits(t *testing.T, ctx Context, id beans.ID) ([]beans.Split, error)

	// User
	UserRegister(t *testing.T, ctx Context, username beans.Username, password beans.Password) error
	UserLogin(t *testing.T, ctx Context, username beans.Username, password beans.Password) (beans.SessionID, error)
	UserLogout(t *testing.T, ctx Context) error
	UserGetMe(t *testing.T, ctx Context) (beans.UserPublic, error)
}

type MonthOpts

type MonthOpts struct {
	Date      string
	Carryover string
}

type PayeeOpts

type PayeeOpts struct{}

type SplitOpt

type SplitOpt struct {
	Amount   string
	Category beans.Category
	Notes    string
}

type SplitOpts

type SplitOpts struct {
	Account beans.Account
	Payee   beans.Payee
	Date    string

	Splits []SplitOpt
}

type TransactionOpts

type TransactionOpts struct {
	Account  beans.Account
	Category beans.Category
	Payee    beans.Payee
	Amount   string
	Date     string
	Notes    string
}

type TransferOpts

type TransferOpts struct {
	AccountA beans.Account
	AccountB beans.Account

	Amount string
	Date   string
	Notes  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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