IBAN Component¶
Responsibilities¶
The IBAN component aims to be the interface for all things related to IBANs, be it in a settlement fashion (we wire money to members or health professionals), or a billing fashion (we receive money from members, ie premiums).
[!NOTE] 🏗️ This component is still work-in-progress. It's small for now and does only contain one model related to IBAN
Provider-specific counterparty metadata¶
The component is responsible to maintain the counterparty information on each provider for which we need to deal with IBAN.
When we use a provider to wire money to a member, we need to create a counterparty account on the provider's side. This counterparty account creation yields a counterparty metadata object, containing provider-specific information that we then use to properly identify the counterparty (the user) when we wire money to them, or when we bill them.
💁 Ex: For Revolut, this counterparty data consists of a counterparty_id and an account_id. It's defined in the CounterPartyInfo
dataclass in shared/services/revolut/entities.py file.
This counterparty data is specific to: - an IBAN - a provider - and an account at the provider
[!IMPORTANT] The last point is important: we can have multiple counterparty data for a given IBAN and provider, if we have multiple accounts at the provider for this IBAN. Ex: we transitionned from a global account at Revolut to different accounts (to differentiate between Health and Prevoyance for instance). Counterparty data is not shared between the accounts, hence we need to maintain multiple counterparty data for a given IBAN and provider.
Public¶
Business logic¶
We only expose a method to add or update counterparty data for a given tuple of IBAN, provider and business account.
TODO: - add a method to use counterparty data for a given tuple of IBAN, provider and business account.
Internal¶
DB¶
- All IBAN related models live in the
ibanschema
Relevant threads¶
About the choice of making a component and challenges: thread ⧉
About the future models / logic to add: thread ⧉