repository

package
v0.0.0-...-693896e Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BankAccount

type BankAccount interface {
	Startup()
	Shutdown()
	ExistsByID(id uuid.UUID) (exists bool, err error)
	ExistsBalanceByID(id uuid.UUID) (exists bool, err error)
	ResolveByIDs(ids []uuid.UUID) (bankAccounts []model.BankAccount, err error)
	ResolveBalancesByIDs(ids []uuid.UUID) (bankAccountBalances []model.BankAccountBalance, err error)
	ResolveByFilter(filter filter.Filter) (bankAccounts []model.BankAccount, pageInfo model.PageInfoOutput, err error)
	ResolveBalancesByFilter(filter filter.Filter) (bankAccountBalances []model.BankAccountBalance, pageInfo model.PageInfoOutput, err error)
	ResolveLastBalancesByBankAccountID(id uuid.UUID, count int) (bankAccountBalances []model.BankAccountBalance, err error)
	Create(bankAccount model.BankAccount) error
	Update(bankAccount model.BankAccount) error
	CreateBalance(bankAccountBalance model.BankAccountBalance, bankAccount *model.BankAccount) error
	UpdateBalance(bankAccountBalance model.BankAccountBalance, bankAccount *model.BankAccount) error
}

BankAccount is the Bank Account repository interface

type BankAccountMySQLRepo

type BankAccountMySQLRepo struct {
	DB *database.MySQL `inject:"mysql"`
}

BankAccountMySQLRepo is the repository for Bank Accounts implemented with MySQL backend

func (*BankAccountMySQLRepo) Create

func (r *BankAccountMySQLRepo) Create(bankAccount model.BankAccount) error

Create creates a Bank Account

func (*BankAccountMySQLRepo) CreateBalance

func (r *BankAccountMySQLRepo) CreateBalance(bankAccountBalance model.BankAccountBalance, bankAccount *model.BankAccount) error

CreateBalance creates a new Bank Account Balance and optionally updates the Bank Account transactionally

func (*BankAccountMySQLRepo) ExistsBalanceByID

func (r *BankAccountMySQLRepo) ExistsBalanceByID(id uuid.UUID) (exists bool, err error)

ExistsBalanceByID checks the existence of a Bank Account Balance by its ID

func (*BankAccountMySQLRepo) ExistsByID

func (r *BankAccountMySQLRepo) ExistsByID(id uuid.UUID) (exists bool, err error)

ExistsByID checks the existence of a Bank Account by its ID

func (*BankAccountMySQLRepo) ResolveBalancesByFilter

func (r *BankAccountMySQLRepo) ResolveBalancesByFilter(filter filter.Filter) (bankAccountBalances []model.BankAccountBalance, pageInfo model.PageInfoOutput, err error)

ResolveBalancesByFilter resolves Banks Account Balances by a specified filter

func (*BankAccountMySQLRepo) ResolveBalancesByIDs

func (r *BankAccountMySQLRepo) ResolveBalancesByIDs(ids []uuid.UUID) (bankAccountBalances []model.BankAccountBalance, err error)

ResolveBalancesByIDs resoloves Bank Account Balances by their IDs

func (*BankAccountMySQLRepo) ResolveByFilter

func (r *BankAccountMySQLRepo) ResolveByFilter(filter filter.Filter) (bankAccounts []model.BankAccount, pageInfo model.PageInfoOutput, err error)

ResolveByFilter resolves Banks Accounts by a specified filter

func (*BankAccountMySQLRepo) ResolveByIDs

func (r *BankAccountMySQLRepo) ResolveByIDs(ids []uuid.UUID) (bankAccounts []model.BankAccount, err error)

ResolveByIDs resolves Bank Accounts by their IDs

func (*BankAccountMySQLRepo) ResolveLastBalancesByBankAccountID

func (r *BankAccountMySQLRepo) ResolveLastBalancesByBankAccountID(id uuid.UUID, count int) (bankAccountBalances []model.BankAccountBalance, err error)

ResolveLastBalancesByBankAccountID resolves last X Bank Account Balances by their Bank Account ID and count param

func (*BankAccountMySQLRepo) Shutdown

func (r *BankAccountMySQLRepo) Shutdown()

Shutdown cleans up everything and shuts down

func (*BankAccountMySQLRepo) Startup

func (r *BankAccountMySQLRepo) Startup()

Startup perform startup functions

func (*BankAccountMySQLRepo) Update

func (r *BankAccountMySQLRepo) Update(bankAccount model.BankAccount) error

Update updates a bank account

func (*BankAccountMySQLRepo) UpdateBalance

func (r *BankAccountMySQLRepo) UpdateBalance(bankAccountBalance model.BankAccountBalance, bankAccount *model.BankAccount) error

UpdateBalance updates an existing Bank Account Balance and optionally updates the Bank Account transactionally

type User

type User interface {
	Startup()
	Shutdown()
	ExistsByID(id uuid.UUID) (exists bool, err error)
	ResolveByIDs(ids []uuid.UUID) (users []model.User, err error)
	ResolveByIdentity(identity string) (user model.User, err error)
	ResolveByFilter(filter filter.Filter) (users []model.User, pageInfo model.PageInfoOutput, err error)
	Create(user model.User) error
	Update(user model.User) error
}

User is the User repository interface

type UserMySQLRepo

type UserMySQLRepo struct {
	DB *database.MySQL `inject:"mysql"`
}

UserMySQLRepo is the repository for Users implemented with MySQL backend

func (*UserMySQLRepo) Create

func (r *UserMySQLRepo) Create(user model.User) error

Create creates a User

func (*UserMySQLRepo) ExistsByID

func (r *UserMySQLRepo) ExistsByID(id uuid.UUID) (exists bool, err error)

ExistsByID checks the existence of a User by its ID

func (*UserMySQLRepo) ResolveByFilter

func (r *UserMySQLRepo) ResolveByFilter(filter filter.Filter) (users []model.User, pageInfo model.PageInfoOutput, err error)

ResolveByFilter resolves Users by a specified filter

func (*UserMySQLRepo) ResolveByIDs

func (r *UserMySQLRepo) ResolveByIDs(ids []uuid.UUID) (users []model.User, err error)

ResolveByIDs resolves Users by their IDs

func (*UserMySQLRepo) ResolveByIdentity

func (r *UserMySQLRepo) ResolveByIdentity(identity string) (user model.User, err error)

ResolveByIdentity resolves a User by its username or email

func (*UserMySQLRepo) Shutdown

func (r *UserMySQLRepo) Shutdown()

Shutdown cleans up everything and shuts down

func (*UserMySQLRepo) Startup

func (r *UserMySQLRepo) Startup()

Startup perform startup functions

func (*UserMySQLRepo) Update

func (r *UserMySQLRepo) Update(user model.User) error

Update updates a User

Jump to

Keyboard shortcuts

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