transaction
Classes:
-
DepositTransaction
–Class representing a deposit transaction.
-
DepositWithdrawTransaction
–Class representing a deposit withdrawal transaction.
-
EquityIssuanceTransaction
–Class representing an equity issuance transaction.
-
InterestPaidOnDepositTransaction
–Class representing an interest paid on deposit transaction.
-
LoanDisbursementTransaction
–Class representing a loan disbursement transaction.
-
LoanInterestPaymentTransaction
–Class representing a loan interest payment transaction.
-
LoanRepaymentTransaction
–Class representing a matured loan repayment transaction.
-
MortgageInterestPaymentTransaction
–Class representing a mortgage interest payment transaction.
-
MortgagePrincipalPaymentTransaction
–Class representing a mortgage principal payment transaction.
-
SecurityInterestEarnedTransaction
–Class representing a banking book security (HTM or FVOCI) interest earned transaction.
-
SecurityMarkToMarketFVOCITransaction
–Class representing a security mark-to-market adjustment for FVOCI transaction.
-
SecurityMarkToMarketFVTPLTransaction
–Class representing a security mark-to-market adjustment for FVTPL transaction.
-
SecurityPurchaseFVOCITransaction
–Class representing a security purchase FVOCI (Fair Value through Other Comprehensive Income) transaction.
-
SecurityPurchaseFVTPLTransaction
–Class representing a security purchase FVTPL (Fair Value through Profit or Loss) transaction.
-
SecurityPurchaseHTMTransaction
–Class representing a security purchase held-to-maturity (HTM) transaction.
-
SecuritySaleFVOCITransaction
–Class representing a security sale FVOCI (Fair Value through Other Comprehensive Income) transaction.
-
SecuritySaleFVTPLTransaction
–Class representing a security sale FVTPL (Fair Value through Profit or Loss) transaction.
-
SecuritySaleHTMTransaction
–Class representing a security sale held-to-maturity (HTM) transaction.
-
Transaction
–Abstract Command class for transactions.
-
TransactionFactory
–Factory class to create transaction instances dynamically.
-
TransactionType
–Enumeration of different types of transactions.
DepositTransaction
dataclass
DepositTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a deposit transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
DepositWithdrawTransaction
dataclass
DepositWithdrawTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a deposit withdrawal transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
EquityIssuanceTransaction
dataclass
EquityIssuanceTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing an equity issuance transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
InterestPaidOnDepositTransaction
dataclass
InterestPaidOnDepositTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing an interest paid on deposit transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
LoanDisbursementTransaction
dataclass
LoanDisbursementTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a loan disbursement transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
LoanInterestPaymentTransaction
dataclass
LoanInterestPaymentTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a loan interest payment transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
LoanRepaymentTransaction
dataclass
LoanRepaymentTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a matured loan repayment transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
MortgageInterestPaymentTransaction
dataclass
MortgageInterestPaymentTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: LoanInterestPaymentTransaction
Class representing a mortgage interest payment transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
MortgagePrincipalPaymentTransaction
MortgagePrincipalPaymentTransaction(
bank: Bank,
instrument: Cash,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
mortgage: Mortgage | None = None,
)
Bases: Transaction
Class representing a mortgage principal payment transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
SecurityInterestEarnedTransaction
dataclass
SecurityInterestEarnedTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a banking book security (HTM or FVOCI) interest earned transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
SecurityMarkToMarketFVOCITransaction
dataclass
SecurityMarkToMarketFVOCITransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a security mark-to-market adjustment for FVOCI transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
SecurityMarkToMarketFVTPLTransaction
dataclass
SecurityMarkToMarketFVTPLTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a security mark-to-market adjustment for FVTPL transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
SecurityPurchaseFVOCITransaction
dataclass
SecurityPurchaseFVOCITransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a security purchase FVOCI (Fair Value through Other Comprehensive Income) transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
SecurityPurchaseFVTPLTransaction
dataclass
SecurityPurchaseFVTPLTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a security purchase FVTPL (Fair Value through Profit or Loss) transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
SecurityPurchaseHTMTransaction
dataclass
SecurityPurchaseHTMTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a security purchase held-to-maturity (HTM) transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
SecuritySaleFVOCITransaction
dataclass
SecuritySaleFVOCITransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a security sale FVOCI (Fair Value through Other Comprehensive Income) transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
SecuritySaleFVTPLTransaction
dataclass
SecuritySaleFVTPLTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a security sale FVTPL (Fair Value through Profit or Loss) transaction.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
SecuritySaleHTMTransaction
dataclass
SecuritySaleHTMTransaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: Transaction
Class representing a security sale held-to-maturity (HTM) transaction.
HTM securities should not be sold before maturity! This should be interpreted as the HTM security matures and removed from banking book.
Methods:
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
Transaction
dataclass
Transaction(
bank: Bank,
instrument: Instrument,
value: float,
transaction_type: TransactionType,
description: str = "",
transaction_date: date | None = None,
valuation_visitor: ValuationVisitor | None = None,
executed: bool = False,
)
Bases: ABC
Abstract Command class for transactions.
Methods:
-
controller_actions
–Return a mapping from instruments to actions, including book type and position.
-
execute
–Execute the transaction and post entries to the ledger.
-
undo
–Reverse the transaction (rollback).
Attributes:
-
journal_entry
(JournalEntry
) –Return the journal entry for the transaction.
-
reverse_journal_entry
(JournalEntry
) –Return the reverse journal entry to undo the transaction.
journal_entry
abstractmethod
property
journal_entry: JournalEntry
Return the journal entry for the transaction.
reverse_journal_entry
property
reverse_journal_entry: JournalEntry
Return the reverse journal entry to undo the transaction.
controller_actions
controller_actions() -> GUIControllerInstruction
Return a mapping from instruments to actions, including book type and position.
This instruction set is used by GUI's controllers to update views. In other uses it can be safely ignore.
execute
execute() -> bool
Execute the transaction and post entries to the ledger.
This method checks if the transaction has already been executed. If not, it
executes the transaction by calling the _execute
method and sets the
executed
flag to True.
Returns:
-
bool
(bool
) –True if the transaction was executed, False if it was already executed.
undo
undo() -> bool
Reverse the transaction (rollback).
TransactionFactory
Factory class to create transaction instances dynamically.
Methods:
-
create_transaction
–Create transaction instances dynamically.
-
get_registered_transaction_types
–Return a list of all registered transaction types.
-
register_transaction
–Register a transaction type with its corresponding class.
create_transaction
classmethod
create_transaction(
*,
bank: Bank,
transaction_type: TransactionType,
instrument: Instrument,
transaction_value: float | None = None,
valuation_visitor: ValuationVisitor | None = None,
description: str = "",
transaction_date: date | None = None,
**kwargs,
) -> Transaction
Create transaction instances dynamically.
get_registered_transaction_types
classmethod
get_registered_transaction_types() -> list[TransactionType]
Return a list of all registered transaction types.
register_transaction
classmethod
register_transaction(
transaction_type: TransactionType,
transaction_cls: type[Transaction],
) -> None
Register a transaction type with its corresponding class.
TransactionType
Bases: Enum
Enumeration of different types of transactions.