debit

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorDebitInvalidPinForAccount if the given pin is not equals with the stored hashed pin
	ErrorDebitInvalidPinForAccount = errors.New("invalid pin for checking account")
	// ErrorDebitInvalidAmount if the given debit operation amount is a negative number
	ErrorDebitInvalidAmount = errors.New("invalid debit amount. Amount has to be positive")
	// ErrorDebitExceedsOverdraftLimit if the given debit operation would exceed the overall checkingAccount balance
	ErrorDebitExceedsOverdraftLimit = errors.New("debit amount exceeds the overdraft limit")
)

Functions

This section is empty.

Types

type UseCase

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

UseCase manages all debit operations

func NewUseCase

func NewUseCase(cm checking_account.Manager) *UseCase

NewUseCase inits a new debit UseCase

func (*UseCase) Debit

func (uc *UseCase) Debit(ctx context.Context, checkingAccountNumber entity.ID, amount float64, pin string) error

Debit operation for the given CheckingAccount

Jump to

Keyboard shortcuts

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