Documentation
¶
Overview ¶
Package commands contains the application's command message definitions.
Index ¶
- type ApproveDeposit
- type ApproveTransfer
- type ApproveWithdrawal
- type ConsumeDailyDebitLimit
- type CreditAccount
- type CreditThirdPartyAccount
- type DebitAccount
- type DeclineTransfer
- type DeclineWithdrawal
- type Deposit
- type MarkTransferAsFailed
- type OpenAccount
- type OpenAccountForNewCustomer
- type Transfer
- type Withdraw
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApproveDeposit ¶
ApproveDeposit is a command that approves an account deposit.
func (*ApproveDeposit) MarshalBinary ¶
func (m *ApproveDeposit) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*ApproveDeposit) MessageDescription ¶
func (m *ApproveDeposit) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*ApproveDeposit) UnmarshalBinary ¶
func (m *ApproveDeposit) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*ApproveDeposit) Validate ¶
func (m *ApproveDeposit) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type ApproveTransfer ¶
type ApproveTransfer struct {
TransactionID string
FromAccountID string
ToAccountID string
Amount int64
}
ApproveTransfer is a command that approves an account transfer.
func (*ApproveTransfer) MarshalBinary ¶
func (m *ApproveTransfer) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*ApproveTransfer) MessageDescription ¶
func (m *ApproveTransfer) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*ApproveTransfer) UnmarshalBinary ¶
func (m *ApproveTransfer) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*ApproveTransfer) Validate ¶
func (m *ApproveTransfer) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type ApproveWithdrawal ¶
ApproveWithdrawal is a command that approves an account withdrawal.
func (*ApproveWithdrawal) MarshalBinary ¶
func (m *ApproveWithdrawal) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*ApproveWithdrawal) MessageDescription ¶
func (m *ApproveWithdrawal) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*ApproveWithdrawal) UnmarshalBinary ¶
func (m *ApproveWithdrawal) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*ApproveWithdrawal) Validate ¶
func (m *ApproveWithdrawal) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type ConsumeDailyDebitLimit ¶
type ConsumeDailyDebitLimit struct {
TransactionID string
AccountID string
DebitType messages.TransactionType
Amount int64
Date string
}
ConsumeDailyDebitLimit is a command requesting that an amount of an account daily debit limit be consumed.
func (*ConsumeDailyDebitLimit) MarshalBinary ¶
func (m *ConsumeDailyDebitLimit) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*ConsumeDailyDebitLimit) MessageDescription ¶
func (m *ConsumeDailyDebitLimit) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*ConsumeDailyDebitLimit) UnmarshalBinary ¶
func (m *ConsumeDailyDebitLimit) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*ConsumeDailyDebitLimit) Validate ¶
func (m *ConsumeDailyDebitLimit) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type CreditAccount ¶
type CreditAccount struct {
TransactionID string
AccountID string
TransactionType messages.TransactionType
Amount int64
}
CreditAccount is a command that requests a bank account be credited.
func (*CreditAccount) MarshalBinary ¶
func (m *CreditAccount) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*CreditAccount) MessageDescription ¶
func (m *CreditAccount) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*CreditAccount) UnmarshalBinary ¶
func (m *CreditAccount) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*CreditAccount) Validate ¶
func (m *CreditAccount) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type CreditThirdPartyAccount ¶
CreditThirdPartyAccount is a command to credit an account held at a third-party bank.
func (*CreditThirdPartyAccount) MarshalBinary ¶
func (m *CreditThirdPartyAccount) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*CreditThirdPartyAccount) MessageDescription ¶
func (m *CreditThirdPartyAccount) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*CreditThirdPartyAccount) UnmarshalBinary ¶
func (m *CreditThirdPartyAccount) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*CreditThirdPartyAccount) Validate ¶
func (m *CreditThirdPartyAccount) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type DebitAccount ¶
type DebitAccount struct {
TransactionID string
AccountID string
TransactionType messages.TransactionType
Amount int64
ScheduledTime time.Time
}
DebitAccount is a command that requests a bank account be debited.
func (*DebitAccount) MarshalBinary ¶
func (m *DebitAccount) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*DebitAccount) MessageDescription ¶
func (m *DebitAccount) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*DebitAccount) UnmarshalBinary ¶
func (m *DebitAccount) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*DebitAccount) Validate ¶
func (m *DebitAccount) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type DeclineTransfer ¶
type DeclineTransfer struct {
TransactionID string
FromAccountID string
ToAccountID string
Amount int64
Reason messages.DebitFailureReason
}
DeclineTransfer is a command that rejects an account transfer.
func (*DeclineTransfer) MarshalBinary ¶
func (m *DeclineTransfer) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*DeclineTransfer) MessageDescription ¶
func (m *DeclineTransfer) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*DeclineTransfer) UnmarshalBinary ¶
func (m *DeclineTransfer) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*DeclineTransfer) Validate ¶
func (m *DeclineTransfer) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type DeclineWithdrawal ¶
type DeclineWithdrawal struct {
TransactionID string
AccountID string
Amount int64
Reason messages.DebitFailureReason
}
DeclineWithdrawal is a command that rejects an account withdrawal.
func (*DeclineWithdrawal) MarshalBinary ¶
func (m *DeclineWithdrawal) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*DeclineWithdrawal) MessageDescription ¶
func (m *DeclineWithdrawal) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*DeclineWithdrawal) UnmarshalBinary ¶
func (m *DeclineWithdrawal) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*DeclineWithdrawal) Validate ¶
func (m *DeclineWithdrawal) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type Deposit ¶
Deposit is a command requesting that funds be deposited into a bank account.
func (*Deposit) MarshalBinary ¶
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*Deposit) MessageDescription ¶
MessageDescription returns a human-readable description of the message.
func (*Deposit) UnmarshalBinary ¶
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
type MarkTransferAsFailed ¶
type MarkTransferAsFailed struct {
TransactionID string
FromAccountID string
ToAccountID string
Amount int64
}
MarkTransferAsFailed is a command that marks an account transfer as failed due to an operational error that occurred after the transfer was initiated.
func (*MarkTransferAsFailed) MarshalBinary ¶
func (m *MarkTransferAsFailed) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*MarkTransferAsFailed) MessageDescription ¶
func (m *MarkTransferAsFailed) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*MarkTransferAsFailed) UnmarshalBinary ¶
func (m *MarkTransferAsFailed) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*MarkTransferAsFailed) Validate ¶
func (m *MarkTransferAsFailed) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type OpenAccount ¶
OpenAccount is a command requesting that a new bank account be opened for an existing customer.
func (*OpenAccount) MarshalBinary ¶
func (m *OpenAccount) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*OpenAccount) MessageDescription ¶
func (m *OpenAccount) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*OpenAccount) UnmarshalBinary ¶
func (m *OpenAccount) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*OpenAccount) Validate ¶
func (m *OpenAccount) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type OpenAccountForNewCustomer ¶
type OpenAccountForNewCustomer struct {
CustomerID string
CustomerName string
AccountID string
AccountName string
}
OpenAccountForNewCustomer is a command requesting that a new bank account be opened for a new customer.
func (*OpenAccountForNewCustomer) MarshalBinary ¶
func (m *OpenAccountForNewCustomer) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*OpenAccountForNewCustomer) MessageDescription ¶
func (m *OpenAccountForNewCustomer) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*OpenAccountForNewCustomer) UnmarshalBinary ¶
func (m *OpenAccountForNewCustomer) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*OpenAccountForNewCustomer) Validate ¶
func (m *OpenAccountForNewCustomer) Validate(dogma.CommandValidationScope) error
Validate returns a non-nil error if the message is invalid.
type Transfer ¶
type Transfer struct {
TransactionID string
FromAccountID string
ToAccountID string
ToThirdPartyBank bool
Amount int64
ScheduledTime time.Time
}
Transfer is a command requesting that funds be transferred from one bank account to another.
func (*Transfer) MarshalBinary ¶
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*Transfer) MessageDescription ¶
MessageDescription returns a human-readable description of the message.
func (*Transfer) UnmarshalBinary ¶
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
type Withdraw ¶
Withdraw is a command requesting that funds be withdrawn from a bank account.
func (*Withdraw) MarshalBinary ¶
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*Withdraw) MessageDescription ¶
MessageDescription returns a human-readable description of the message.
func (*Withdraw) UnmarshalBinary ¶
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.