Documentation
¶
Overview ¶
Package events contains the application's event message definitions.
Index ¶
- type AccountCredited
- type AccountDebitDeclined
- type AccountDebited
- type AccountOpened
- type CustomerAcquired
- type DailyDebitLimitConsumed
- type DailyDebitLimitExceeded
- type DepositApproved
- type DepositStarted
- type ThirdPartyAccountCreditFailed
- type ThirdPartyAccountCredited
- type TransferApproved
- type TransferDeclined
- type TransferFailed
- type TransferStarted
- type WithdrawalApproved
- type WithdrawalDeclined
- type WithdrawalStarted
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountCredited ¶
type AccountCredited struct {
TransactionID string
AccountID string
TransactionType messages.TransactionType
Amount int64
}
AccountCredited is an event indicating that a bank account was credited.
func (*AccountCredited) MarshalBinary ¶
func (m *AccountCredited) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*AccountCredited) MessageDescription ¶
func (m *AccountCredited) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*AccountCredited) UnmarshalBinary ¶
func (m *AccountCredited) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*AccountCredited) Validate ¶
func (m *AccountCredited) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type AccountDebitDeclined ¶
type AccountDebitDeclined struct {
TransactionID string
AccountID string
TransactionType messages.TransactionType
Amount int64
Reason messages.DebitFailureReason
}
AccountDebitDeclined is an event indicating that a bank account debit was declined.
func (*AccountDebitDeclined) MarshalBinary ¶
func (m *AccountDebitDeclined) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*AccountDebitDeclined) MessageDescription ¶
func (m *AccountDebitDeclined) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*AccountDebitDeclined) UnmarshalBinary ¶
func (m *AccountDebitDeclined) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*AccountDebitDeclined) Validate ¶
func (m *AccountDebitDeclined) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type AccountDebited ¶
type AccountDebited struct {
TransactionID string
AccountID string
TransactionType messages.TransactionType
Amount int64
ScheduledTime time.Time
}
AccountDebited is an event indicating that a bank account was debited.
func (*AccountDebited) MarshalBinary ¶
func (m *AccountDebited) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*AccountDebited) MessageDescription ¶
func (m *AccountDebited) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*AccountDebited) UnmarshalBinary ¶
func (m *AccountDebited) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*AccountDebited) Validate ¶
func (m *AccountDebited) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type AccountOpened ¶
AccountOpened is an event indicating that a new bank account has been opened.
func (*AccountOpened) MarshalBinary ¶
func (m *AccountOpened) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*AccountOpened) MessageDescription ¶
func (m *AccountOpened) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*AccountOpened) UnmarshalBinary ¶
func (m *AccountOpened) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*AccountOpened) Validate ¶
func (m *AccountOpened) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type CustomerAcquired ¶
type CustomerAcquired struct {
CustomerID string
CustomerName string
AccountID string
AccountName string
}
CustomerAcquired is an event indicating that a new customer has been acquired.
func (*CustomerAcquired) MarshalBinary ¶
func (m *CustomerAcquired) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*CustomerAcquired) MessageDescription ¶
func (m *CustomerAcquired) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*CustomerAcquired) UnmarshalBinary ¶
func (m *CustomerAcquired) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*CustomerAcquired) Validate ¶
func (m *CustomerAcquired) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type DailyDebitLimitConsumed ¶
type DailyDebitLimitConsumed struct {
TransactionID string
AccountID string
DebitType messages.TransactionType
Amount int64
Date string
TotalDebitsForDay int64
DailyLimit int64
}
DailyDebitLimitConsumed is an event that indicates an amount of an account daily debit limit has been consumed.
func (*DailyDebitLimitConsumed) MarshalBinary ¶
func (m *DailyDebitLimitConsumed) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*DailyDebitLimitConsumed) MessageDescription ¶
func (m *DailyDebitLimitConsumed) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*DailyDebitLimitConsumed) UnmarshalBinary ¶
func (m *DailyDebitLimitConsumed) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*DailyDebitLimitConsumed) Validate ¶
func (m *DailyDebitLimitConsumed) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type DailyDebitLimitExceeded ¶
type DailyDebitLimitExceeded struct {
TransactionID string
AccountID string
DebitType messages.TransactionType
Amount int64
Date string
TotalDebitsForDay int64
DailyLimit int64
}
DailyDebitLimitExceeded is an event that indicates an attempt to consume from an account daily debit limit has been rejected due to reaching the limit.
func (*DailyDebitLimitExceeded) MarshalBinary ¶
func (m *DailyDebitLimitExceeded) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*DailyDebitLimitExceeded) MessageDescription ¶
func (m *DailyDebitLimitExceeded) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*DailyDebitLimitExceeded) UnmarshalBinary ¶
func (m *DailyDebitLimitExceeded) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*DailyDebitLimitExceeded) Validate ¶
func (m *DailyDebitLimitExceeded) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type DepositApproved ¶
DepositApproved is an event that indicates a requested deposit has been approved.
func (*DepositApproved) MarshalBinary ¶
func (m *DepositApproved) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*DepositApproved) MessageDescription ¶
func (m *DepositApproved) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*DepositApproved) UnmarshalBinary ¶
func (m *DepositApproved) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*DepositApproved) Validate ¶
func (m *DepositApproved) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type DepositStarted ¶
DepositStarted is an event indicating that the process of depositing funds into an account has begun.
func (*DepositStarted) MarshalBinary ¶
func (m *DepositStarted) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*DepositStarted) MessageDescription ¶
func (m *DepositStarted) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*DepositStarted) UnmarshalBinary ¶
func (m *DepositStarted) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*DepositStarted) Validate ¶
func (m *DepositStarted) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type ThirdPartyAccountCreditFailed ¶
ThirdPartyAccountCreditFailed is an event indicating that the credit to a third-party bank account could not be completed.
func (*ThirdPartyAccountCreditFailed) MarshalBinary ¶
func (m *ThirdPartyAccountCreditFailed) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*ThirdPartyAccountCreditFailed) MessageDescription ¶
func (m *ThirdPartyAccountCreditFailed) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*ThirdPartyAccountCreditFailed) UnmarshalBinary ¶
func (m *ThirdPartyAccountCreditFailed) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*ThirdPartyAccountCreditFailed) Validate ¶
func (m *ThirdPartyAccountCreditFailed) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type ThirdPartyAccountCredited ¶
ThirdPartyAccountCredited is an event indicating that the credit to a third-party bank account was completed successfully.
func (*ThirdPartyAccountCredited) MarshalBinary ¶
func (m *ThirdPartyAccountCredited) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*ThirdPartyAccountCredited) MessageDescription ¶
func (m *ThirdPartyAccountCredited) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*ThirdPartyAccountCredited) UnmarshalBinary ¶
func (m *ThirdPartyAccountCredited) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*ThirdPartyAccountCredited) Validate ¶
func (m *ThirdPartyAccountCredited) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type TransferApproved ¶
type TransferApproved struct {
TransactionID string
FromAccountID string
ToAccountID string
Amount int64
}
TransferApproved is an event that indicates a requested transfer has been approved.
func (*TransferApproved) MarshalBinary ¶
func (m *TransferApproved) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*TransferApproved) MessageDescription ¶
func (m *TransferApproved) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*TransferApproved) UnmarshalBinary ¶
func (m *TransferApproved) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*TransferApproved) Validate ¶
func (m *TransferApproved) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type TransferDeclined ¶
type TransferDeclined struct {
TransactionID string
FromAccountID string
ToAccountID string
Amount int64
Reason messages.DebitFailureReason
}
TransferDeclined is an event that indicates a requested transfer has been declined.
func (*TransferDeclined) MarshalBinary ¶
func (m *TransferDeclined) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*TransferDeclined) MessageDescription ¶
func (m *TransferDeclined) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*TransferDeclined) UnmarshalBinary ¶
func (m *TransferDeclined) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*TransferDeclined) Validate ¶
func (m *TransferDeclined) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type TransferFailed ¶
type TransferFailed struct {
TransactionID string
FromAccountID string
ToAccountID string
Amount int64
}
TransferFailed is an event that indicates a transfer failed due to an operational error after the transfer was initiated.
func (*TransferFailed) MarshalBinary ¶
func (m *TransferFailed) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*TransferFailed) MessageDescription ¶
func (m *TransferFailed) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*TransferFailed) UnmarshalBinary ¶
func (m *TransferFailed) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*TransferFailed) Validate ¶
func (m *TransferFailed) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type TransferStarted ¶
type TransferStarted struct {
TransactionID string
FromAccountID string
ToAccountID string
ToThirdPartyBank bool
Amount int64
ScheduledTime time.Time
}
TransferStarted is an event indicating that the process of transferring funds from one account to another has begun.
func (*TransferStarted) MarshalBinary ¶
func (m *TransferStarted) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*TransferStarted) MessageDescription ¶
func (m *TransferStarted) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*TransferStarted) UnmarshalBinary ¶
func (m *TransferStarted) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*TransferStarted) Validate ¶
func (m *TransferStarted) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type WithdrawalApproved ¶
WithdrawalApproved is an event that indicates a requested withdrawal has been approved.
func (*WithdrawalApproved) MarshalBinary ¶
func (m *WithdrawalApproved) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*WithdrawalApproved) MessageDescription ¶
func (m *WithdrawalApproved) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*WithdrawalApproved) UnmarshalBinary ¶
func (m *WithdrawalApproved) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*WithdrawalApproved) Validate ¶
func (m *WithdrawalApproved) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type WithdrawalDeclined ¶
type WithdrawalDeclined struct {
TransactionID string
AccountID string
Amount int64
Reason messages.DebitFailureReason
}
WithdrawalDeclined is an event that indicates a requested withdrawal has been declined.
func (*WithdrawalDeclined) MarshalBinary ¶
func (m *WithdrawalDeclined) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*WithdrawalDeclined) MessageDescription ¶
func (m *WithdrawalDeclined) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*WithdrawalDeclined) UnmarshalBinary ¶
func (m *WithdrawalDeclined) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*WithdrawalDeclined) Validate ¶
func (m *WithdrawalDeclined) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.
type WithdrawalStarted ¶
type WithdrawalStarted struct {
TransactionID string
AccountID string
Amount int64
ScheduledTime time.Time
}
WithdrawalStarted is an event indicating that the process of withdrawing funds from an account has begun.
func (*WithdrawalStarted) MarshalBinary ¶
func (m *WithdrawalStarted) MarshalBinary() ([]byte, error)
MarshalBinary returns a binary representation of the message. For simplicity in this example we use JSON.
func (*WithdrawalStarted) MessageDescription ¶
func (m *WithdrawalStarted) MessageDescription() string
MessageDescription returns a human-readable description of the message.
func (*WithdrawalStarted) UnmarshalBinary ¶
func (m *WithdrawalStarted) UnmarshalBinary(data []byte) error
UnmarshalBinary populates the message from its binary representation. For simplicity in this example we use JSON.
func (*WithdrawalStarted) Validate ¶
func (m *WithdrawalStarted) Validate(dogma.EventValidationScope) error
Validate returns a non-nil error if the message is invalid.