Models
components.payment_gateway.subcomponents.ledgers.models.helpers ¶
load_all_models ¶
Source code in components/payment_gateway/subcomponents/ledgers/models/helpers.py
components.payment_gateway.subcomponents.ledgers.models.ledger ¶
Ledger ¶
Bases: BaseModel
__table_args__
class-attribute
instance-attribute
¶
additional_admin_properties
class-attribute
instance-attribute
¶
entries
class-attribute
instance-attribute
¶
entries = relationship(
"LedgerEntry",
back_populates="ledger",
order_by="LedgerEntry.created_at.desc()",
uselist=True,
viewonly=True,
)
last_entry
class-attribute
instance-attribute
¶
last_entry = relationship(
"LedgerEntry",
uselist=False,
viewonly=True,
primaryjoin="and_( LedgerEntry.ledger_id == Ledger.id, LedgerEntry.created_at == ( select(func.max(LedgerEntry.created_at)) .where(LedgerEntry.ledger_id == Ledger.id) .correlate(Ledger) .scalar_subquery() ))",
)
reference
class-attribute
instance-attribute
¶
terminated_at
class-attribute
instance-attribute
¶
Termination is done at the initiative of the business layer. Ledgers in terminal state cannot be modified or used anymore.
components.payment_gateway.subcomponents.ledgers.models.ledger_entry ¶
LedgerEntry ¶
Bases: BaseModel
__table_args__
class-attribute
instance-attribute
¶
ending_balance
class-attribute
instance-attribute
¶
entry_metadata
class-attribute
instance-attribute
¶
Note: 'metadata' is reserved so use 'entry_metadata' instead.
external_transaction_id
class-attribute
instance-attribute
¶
ID used to identify transactions originating from the external payment service provider.