events

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package events contains the application's event message definitions.

Index

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

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

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

Validate returns a non-nil error if the message is invalid.

type AccountOpened

type AccountOpened struct {
	CustomerID  string
	AccountID   string
	AccountName string
}

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

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

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

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

Validate returns a non-nil error if the message is invalid.

type DepositApproved

type DepositApproved struct {
	TransactionID string
	AccountID     string
	Amount        int64
}

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

Validate returns a non-nil error if the message is invalid.

type DepositStarted

type DepositStarted struct {
	TransactionID string
	AccountID     string
	Amount        int64
}

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

Validate returns a non-nil error if the message is invalid.

type ThirdPartyAccountCreditFailed

type ThirdPartyAccountCreditFailed struct {
	TransactionID string
	AccountID     string
	Amount        int64
}

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

Validate returns a non-nil error if the message is invalid.

type ThirdPartyAccountCredited

type ThirdPartyAccountCredited struct {
	TransactionID string
	AccountID     string
	Amount        int64
}

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

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

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

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

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

Validate returns a non-nil error if the message is invalid.

type WithdrawalApproved

type WithdrawalApproved struct {
	TransactionID string
	AccountID     string
	Amount        int64
}

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

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

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

Validate returns a non-nil error if the message is invalid.

Jump to

Keyboard shortcuts

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