accounts

package
v0.0.0-...-8305c4b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id                  int
	User                users.User
	AccountNumber       string
	AccountTransactions []AccountTransaction //validate nil
	// contains filtered or unexported fields
}

func (Account) CalculateCurrentBalance

func (b Account) CalculateCurrentBalance() float64

func (Account) GetAvgCreditAmmount

func (b Account) GetAvgCreditAmmount() float64

func (Account) GetAvgDebitAmmount

func (b Account) GetAvgDebitAmmount() float64

type AccountRepository

type AccountRepository interface {
	Save([]AccountTransaction) error
	GetAccountInfo(string) (Account, error)
}

type AccountService

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

func NewAccountService

func NewAccountService(repository AccountRepository) AccountService

func (*AccountService) GetAccountInfo

func (service *AccountService) GetAccountInfo(accountNumber string) (Account, error)

func (*AccountService) Save

func (service *AccountService) Save(transactions []AccountTransaction) error

type AccountTransaction

type AccountTransaction struct {
	Id        int
	AccountId int
	Date      time.Time
	Ammount   float64
}

Jump to

Keyboard shortcuts

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