Documentation
¶
Overview ¶
Package messages contains extra types used by the application's message definitions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DailyDebitLimitDate ¶
DailyDebitLimitDate returns the date of a transaction for the purposes of checking daily debit limits.
It normalizes the date to the UTC timezone so that regardless of which timezone is used to schedule the transaction two equivalent times always contribute towards the same day's limit.
func FormatAmount ¶
FormatAmount formats a cent amount as dollars.
Types ¶
type DebitFailureReason ¶
type DebitFailureReason string
DebitFailureReason defines reasons why a debits may fail.
const ( // InsufficientFunds means there was not enough funds available in the // account to perform the debit. InsufficientFunds DebitFailureReason = "insufficient funds" // DailyDebitLimitExceeded means that the debit cannot be performed // because it will exceed the account daily debit limit. DailyDebitLimitExceeded DebitFailureReason = "daily debit limit exceeded" )
func (DebitFailureReason) Validate ¶
func (r DebitFailureReason) Validate() error
Validate return an error if r is not a valid reason.
type TransactionType ¶
type TransactionType string
TransactionType defines types of debits.
const ( // Deposit is a deposit transaction type. Deposit TransactionType = "deposit" // Withdrawal is a withdrawal transaction type. Withdrawal TransactionType = "withdrawal" // Transfer is a transfer transaction type. Transfer TransactionType = "transfer" )
func (TransactionType) IsDebit ¶
func (t TransactionType) IsDebit() bool
IsDebit returns true if the transaction type is a debit type.
func (TransactionType) Validate ¶
func (t TransactionType) Validate() error
Validate return an error if t is not a valid transaction type.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package commands contains the application's command message definitions.
|
Package commands contains the application's command message definitions. |
|
Package events contains the application's event message definitions.
|
Package events contains the application's event message definitions. |
|
internal
|
|
|
validation
Package validation contains some message validation helpers.
|
Package validation contains some message validation helpers. |