Documentation
¶
Index ¶
- Variables
- type CheckingAccount
- func (c *CheckingAccount) Debit(debitValue float64)
- func (c *CheckingAccount) Deposit(debitValue float64)
- func (c *CheckingAccount) GetCLastUpdateTimestamp() time.Time
- func (c *CheckingAccount) GetCreationTimestamp() time.Time
- func (c *CheckingAccount) GetCurrentBalance() float64
- func (c *CheckingAccount) IsDebitAllowed(debitValue float64) bool
- func (c *CheckingAccount) IsValidPin(pin string) bool
- type Manager
- type MySqlRepository
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 (m *MySqlRepository) Create(ctx context.Context, c CheckingAccount) error
func (*MySqlRepository) Get ¶
func (m *MySqlRepository) Get(ctx context.Context, id entity.ID) (CheckingAccount, error)
func (*MySqlRepository) Update ¶
func (m *MySqlRepository) Update(ctx context.Context, c CheckingAccount) error
Click to show internal directories.
Click to hide internal directories.