checking_account

package
v0.0.0-...-2b752c9 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorEmptyUserInput        = errors.New("user input contains empty fields")
	ErrorInvalidOverdraftLimit = errors.New("overdraft limit has to be a negative number")
)

Functions

This section is empty.

Types

type CheckingAccount

type CheckingAccount struct {
	Number         entity.ID
	Name           string
	OverDraftLimit float64
	// contains filtered or unexported fields
}

func (*CheckingAccount) Debit

func (c *CheckingAccount) Debit(debitValue float64)

func (*CheckingAccount) Deposit

func (c *CheckingAccount) Deposit(debitValue float64)

func (*CheckingAccount) GetCLastUpdateTimestamp

func (c *CheckingAccount) GetCLastUpdateTimestamp() time.Time

func (*CheckingAccount) GetCreationTimestamp

func (c *CheckingAccount) GetCreationTimestamp() time.Time

func (*CheckingAccount) GetCurrentBalance

func (c *CheckingAccount) GetCurrentBalance() float64

func (*CheckingAccount) IsDebitAllowed

func (c *CheckingAccount) IsDebitAllowed(debitValue float64) bool

func (*CheckingAccount) IsValidPin

func (c *CheckingAccount) IsValidPin(pin string) bool

type Manager

type Manager interface {
	Create(ctx context.Context, c CheckingAccount, pin string) (entity.ID, error)
	Update(ctx context.Context, c CheckingAccount, pin string) error
	Get(ctx context.Context, id entity.ID) (CheckingAccount, error)
}

func NewManager

func NewManager(r repository) Manager

type MySqlRepository

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

func NewMySqlRepository

func NewMySqlRepository(client *sql.DB) (*MySqlRepository, error)

func (*MySqlRepository) Create

func (*MySqlRepository) Get

func (*MySqlRepository) Update

Jump to

Keyboard shortcuts

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