Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transaction ¶
type Transaction struct { TXID string AccountID uuid.UUID Amount monetary.Amount Description string TXType TXType Timestamp time.Time CreatedAt time.Time }
Transaction defines billing related transaction info that is stored in the DB.
type TransactionsDB ¶
type TransactionsDB interface { // Insert inserts the provided transaction. Insert(ctx context.Context, tx Transaction) error // List returns all transactions for the specified user. List(ctx context.Context, userID uuid.UUID) ([]Transaction, error) // ListType returns all transactions of a given type for the specified user. ListType(ctx context.Context, userID uuid.UUID, txType TXType) ([]Transaction, error) // ComputeBalance returns the current usable balance for the specified user. ComputeBalance(ctx context.Context, userID uuid.UUID) (monetary.Amount, error) }
TransactionsDB is an interface which defines functionality of DB which stores billing transactions.
architecture: Database
Click to show internal directories.
Click to hide internal directories.