Models
components.payment_gateway.subcomponents.parties.models.ca_local_account_financial_instrument ¶
CALocalAccountData
dataclass
¶
Bases: DataClassJsonMixin
Unencrypted data for CALocalAccountFinancialInstrument
CALocalAccountFinancialInstrument ¶
Bases: FinancialInstrument
A Canadian local account is a type of financial instrument identified by its Institution-Transit-Account numbers within the Canadian banking system.
__mapper_args__
class-attribute
instance-attribute
¶
__table_args__
class-attribute
instance-attribute
¶
__tablename__
class-attribute
instance-attribute
¶
ca_local_account_data
class-attribute
instance-attribute
¶
ca_local_account_data = mapped_column(
StringEncryptedTypeWithOnDemandDecryption(
DataclassString(CALocalAccountData),
get_financial_instruments_encryption_key,
AesGcmEngine,
"pkcs5",
),
nullable=False,
)
id
class-attribute
instance-attribute
¶
components.payment_gateway.subcomponents.parties.models.financial_instrument ¶
FinancialInstrument ¶
Bases: BaseModel
A financial instrument is a mechanism or identifier that enables a Party to send or receive money.
__mapper_args__
class-attribute
instance-attribute
¶
__table_args__
class-attribute
instance-attribute
¶
description
class-attribute
instance-attribute
¶
Human-readable description of the financial instrument.
instrument_type
class-attribute
instance-attribute
¶
instrument_type = mapped_column(
AlanBaseEnumTypeDecorator(FinancialInstrumentType),
nullable=False,
)
Type of the financial instrument: IBAN account, local accounts, etc.
legal_entity
class-attribute
instance-attribute
¶
Legal Entity owning the financial instrument.
legal_entity_id
class-attribute
instance-attribute
¶
ID of the Legal Entity owning the financial instrument.
reference
class-attribute
instance-attribute
¶
Machine-readable reference of the financial instrument.
terminated_at
class-attribute
instance-attribute
¶
Soft deletion timestamp (e.g. for GDPR compliance).
Termination is done at the initiative of the business layer. Financial instruments in terminal state cannot be modified or used anymore.
components.payment_gateway.subcomponents.parties.models.financial_instrument_provider_mapping ¶
FinancialInstrumentProviderMapping ¶
Bases: ProviderEntityMixin, BaseModel
__table_args__ ¶
Source code in components/payment_gateway/subcomponents/parties/models/financial_instrument_provider_mapping.py
__tablename__
class-attribute
instance-attribute
¶
financial_instrument
class-attribute
instance-attribute
¶
financial_instrument_id
class-attribute
instance-attribute
¶
financial_instrument_id = mapped_column(
UUID(as_uuid=True),
ForeignKey(id),
index=True,
nullable=False,
)
components.payment_gateway.subcomponents.parties.models.helpers ¶
FINANCIAL_INSTRUMENTS_ENCRYPTION_KEY_CONFIG_NAME
module-attribute
¶
FINANCIAL_INSTRUMENTS_ENCRYPTION_KEY_CONFIG_NAME = "PAYMENT_GATEWAY_FINANCIAL_INSTRUMENTS_ENCRYPTION_KEY_SECRET_NAME"
get_financial_instruments_encryption_key ¶
load_all_models ¶
Source code in components/payment_gateway/subcomponents/parties/models/helpers.py
components.payment_gateway.subcomponents.parties.models.iban_account_financial_instrument ¶
IBANAccountData
dataclass
¶
Bases: DataClassJsonMixin
Unencrypted data for IBANAccountFinancialInstrument
IBANAccountFinancialInstrument ¶
Bases: FinancialInstrument
An IBAN account is a type of financial instrument identified by its IBAN.
__mapper_args__
class-attribute
instance-attribute
¶
__table_args__
class-attribute
instance-attribute
¶
__tablename__
class-attribute
instance-attribute
¶
iban_account_data
class-attribute
instance-attribute
¶
iban_account_data = mapped_column(
StringEncryptedTypeWithOnDemandDecryption(
DataclassString(IBANAccountData),
get_financial_instruments_encryption_key,
AesGcmEngine,
"pkcs5",
),
nullable=False,
)
id
class-attribute
instance-attribute
¶
components.payment_gateway.subcomponents.parties.models.legal_entity ¶
LegalEntity ¶
Bases: BaseModel
A legal entity is a person or organization with legal capacity to own assets, enter contracts, and conduct financial transactions.
__table_args__
class-attribute
instance-attribute
¶
address_city
class-attribute
instance-attribute
¶
address_city = mapped_column_with_privacy(
String(100),
nullable=True,
privacy_properties=PrivacyProperties(
city,
NoneOrRedactedHashed(),
NoneOrEncrypted(),
PassThrough(),
PassThrough(),
),
)
City name.
address_country_code
class-attribute
instance-attribute
¶
address_country_code = mapped_column_with_privacy(
String(2),
nullable=False,
privacy_properties=PrivacyProperties(
country,
NoneOrRedactedHashed(),
NoneOrEncrypted(),
PassThrough(),
PassThrough(),
PassThrough(),
),
)
Country of the physical address in ISO 3166-1 alpha-2 format.
address_postal_code
class-attribute
instance-attribute
¶
address_postal_code = mapped_column_with_privacy(
String(20),
nullable=True,
privacy_properties=PrivacyProperties(
postcode,
NoneOrRedactedHashed(),
NoneOrEncrypted(),
PassThrough(),
PassThrough(),
),
)
Postal/ZIP code.
address_street
class-attribute
instance-attribute
¶
address_street = mapped_column_with_privacy(
String(255),
nullable=True,
privacy_properties=PrivacyProperties(
street,
NoneOrRedactedHashed(),
NoneOrEncrypted(),
PassThrough(),
PassThrough(),
),
)
Street address line.
address_street_2
class-attribute
instance-attribute
¶
address_street_2 = mapped_column_with_privacy(
String(255),
nullable=True,
privacy_properties=PrivacyProperties(
other,
NoneOrRedactedHashed(),
NoneOrEncrypted(),
PassThrough(),
PassThrough(),
),
)
Street address line 2 (apartment, floor, building, etc.).
address_subdivision_code
class-attribute
instance-attribute
¶
address_subdivision_code = mapped_column_with_privacy(
String(6),
nullable=True,
privacy_properties=PrivacyProperties(
province,
NoneOrRedactedHashed(),
NoneOrEncrypted(),
PassThrough(),
PassThrough(),
PassThrough(),
),
)
State/province/territory code in ISO 3166-2 format (e.g., "CA-ON", "FR-PF", "US-NY").
entity_type
class-attribute
instance-attribute
¶
Type of the legal entity: organization or person.
first_name
class-attribute
instance-attribute
¶
first_name = mapped_column_with_privacy(
String(100),
nullable=True,
privacy_properties=PrivacyProperties(
first_name,
NoneOrRedactedHashed(),
NoneOrEncrypted(),
FakeFirstName(),
PassThrough(),
),
)
First name (persons only).
last_name
class-attribute
instance-attribute
¶
last_name = mapped_column_with_privacy(
String(100),
nullable=True,
privacy_properties=PrivacyProperties(
last_name,
NoneOrRedactedHashed(),
NoneOrEncrypted(),
FakeLastName(),
PassThrough(),
),
)
Last name (persons only).
legal_country_code
class-attribute
instance-attribute
¶
legal_country_code = mapped_column_with_privacy(
String(2),
nullable=False,
privacy_properties=PrivacyProperties(
country,
NoneOrRedactedHashed(),
NoneOrEncrypted(),
PassThrough(),
PassThrough(),
PassThrough(),
),
)
Country of legal registration/jurisdiction in ISO 3166-1 alpha-2 format.
legal_name
class-attribute
instance-attribute
¶
legal_name = mapped_column_with_privacy(
String(255),
nullable=False,
privacy_properties=PrivacyProperties(
some_name,
NoneOrRedactedHashed(),
NoneOrEncrypted(),
FakeFullname(),
PassThrough(),
),
)
Official name (organization) or full name (person).
terminated_at
class-attribute
instance-attribute
¶
Soft deletion timestamp (e.g. for GDPR compliance).
Termination is done at the initiative of the business layer. Legal entities in terminal state cannot be modified or used anymore.
unique_key
class-attribute
instance-attribute
¶
Namespaced unique identifier for deduplication and idempotency.