Domain Model¶
Core Banking Object Relationships¶
flowchart
Card
User["User
(AccountHolder)"]
MajorityAccount["Majority Account"]
LedgerAccount["Ledger Account"]
AccountBalance
TransactionFlow["TransactionFlow
(AggregatedTransaction)"]
Transaction
User -- Has 0 or * --> MajorityAccount
MajorityAccount -- Has 1 or * --> LedgerAccount
LedgerAccount -- Has 0 or * --> TransactionFlow
TransactionFlow -- Groups 1 or * --> Transaction
LedgerAccount -- Has 0 or *--> Card
TransactionFlow -- Used 0 or 1--> Card
MajorityAccount -- Has 1--> AccountBalance
AccountBalance -- Updated by 1 --> Transaction
Transaction -- Referrs to 0 or *--> Transaction
%% Color group definitions
classDef user fill:#E3F2FD,stroke:#1565C0,color:#0D47A1;
classDef wallet fill:#E8F5E9,stroke:#2E7D32,color:#1B5E20;
classDef ledger fill:#FFF3E0,stroke:#EF6C00,color:#E65100;
classDef txn fill:#F3E5F5,stroke:#6A1B9A,color:#4A148C;
%% Class assignments
class User user;
class MajorityAccount,LedgerAccount,Card wallet;
class AccountBalance ledger;
class TransactionFlow,Transaction txn;
Note that many times objects have additional short hand references implemented, e.g. a Transaction has a reference to the Ledger Account and the Card.
The relationships diagram defines how the core transactional entities connect:
- User → MajorityAccount: A single user can have zero or many Majority Accounts (a primary account plus optional pockets or other account types).
- MajorityAccount → LedgerAccount: Each Majority Account must have at least one underlying ledger account. The Ledger Account concept was mainly relevant for the earlier used processor I2C.
- LedgerAccount → TransactionFlow: A ledger account can have any number of transaction flows. A TransactionFlow (AggregatedTransaction) groups the individual transactions that a customer experiences as one action (e.g. a card purchase can consist of auth, completion, settlement, reversal but be presented as a single TransactionFlow to the user).
- TransactionFlow → Transaction: Each flow contains one or more transactions. A Transaction is a single immutable ledger mutation.
- Transaction (self‑relation): Transactions can reffer back to earlier Transactions in the same flow. Transactions can also relate to other transactions not part of the same TransactionFlow. A typical example is a dispute or a cashback which relates to the original transaction.
- LedgerAccount → Card: A ledger account can have zero or many cards (physical, virtual, reissued). Not all ledger activity is card‑driven (e.g. ACH funding, direct deposit), so the association is optional.
- TransactionFlow → Card: A flow can optionally reference the single card used.
- MajorityAccount → AccountBalance: Each Majority Account has exactly one current AccountBalance snapshot row representing latest available balance state.
- AccountBalance → Transaction: The balance snapshot records the Transaction that last updated it
Core Banking Objects¶
User (AccountHolder)¶
This corresponds to a customer of Majority. The User is owned by the User area.
| Name | Type |
|---|---|
| UserId | guid |
Majority Account¶
This is the entity that has a balance. The Majority Account is owned by the Wallet area.
| Name | Type | Desc |
|---|---|---|
| MajorityAccountId | guid | Primary key, randomly generated |
| Created | DateTime | When account was created |
| Updated | DateTime | When account was last updated |
| UserId | guid | UserId that this Account belongs to |
| ExternalReferenceId | nvarchar(50) | .... |
| RoutingNumber | nvarchar(9) | .... |
| AccountNumber | nvarchar(13) | .... |
| AccountType | .... | |
| AccountStatus | .... | |
| IsDefault | bool | A user normally have 1 default account, and 0 or more non-default accounts. |
| BlockedStatus | BlockedStatus(flag) | |
| LatestAccountStatus | .... | |
| AccountLabel | nvarchar(255)? | User provided custom display label. |
| Prn | bigint | Payment Reference Number, used by the banks. |
| ClosedDate | DateTime? | If account was closed, the date and time of closure. |
Ledger Account¶
The Ledger Account is owned by the Wallet area.
| Name | Type | Desc |
|---|---|---|
| LedgerAccountId | guid | PK. |
| MajorityAccountId | guid | Reference to the MajorityAccountId |
| UserId | guid | Shorthand reference to the UserId that the MajorityAccount belongs to. |
| BankId | guid | FK to the Bank where this LedgerAccount exists |
| AccountNumber | nvarchar(50)? | |
| Bin | nvarchar(50)? | |
| ExternalReferenceId | nvarchar(50)? | |
| LedgerType | ||
| ReissuedById | guid | ??? |
| Status | ||
| CurrencyCode | nchar(3) | |
| Created | datetime2 | |
| Updated | datetime2 | |
| IsDefault | bool | |
| RoutingNumber | ||
| BlockedStatus | BlockedStatus(flag) | |
| LatestStatus | ||
| Prn | bigint | Payment Reference Number, used by the banks to identify this account. |
| ExternalLedgerAccountId | ||
| ProductId | ||
| Closed | datetime2 | If account was closed, the date and time of closure. |
Card¶
The Card is owned by the Wallet area. Note that the sensitive data (PAN, CVV etc) of the card is stored in CDE.CardData.
| Name | Type | Desc |
|---|---|---|
| CardId | guid | PK. Id of Card |
| LedgerAccountId | guid | FK to the Ledger Account |
| CardStatus | CardStatus | Status of card |
| BlockedStatus | BlockedStatus | Blocks of the card. |
| IsDefaultCard | bool | Is this the default card? |
| IsPhysicalCard | bool | Is this card a physical card (and not virtual card) |
Account Balance¶
The actual balance of an account. See Account Balance for details of the various balances an account has.
The Account Balance is owned by the Ledger area.
| Name | Type | Desc |
|---|---|---|
| MajorityAccountId | guid | PK. The account that has this balance. |
| AvailableBalance | money | Available balance to spend. |
| ReservedAmount | money | How much balance that are reserved. Posted balance = available balance + reserved amount. |
| TransactionId | varchar(50) | TransactionId of transaction that modified the balance to its current value. |
| BalanceTime | datetime2 | The date and time the balance were last updated. |
TransactionFlow¶
Also called AggregatedTransaction internally. The TransactionFlow groups a number of transactions that all belong to the same business transaction.
From a users point of view this is a transaction. This is what is shown in the transaction list in the App (and also often what is shown in Looker, i.e count of PosPurchases made a in a day). It is important to not confuse this with the actual Transaction below.
| Name | Type | Desc |
|---|---|---|
| TransactionFlowId | guid | PK. |
| TransactionId | guid | Reference to the initial transaction for this flow. |
| LatestTransactionId | guid | Reference to the last transaction in this flow. |
| LedgerAccountId | guid | Reference to the Ledger Account |
| OwnerResourceId | guid | |
| Status | TransactionStatus | The status of the flow, which is the status of latest transaction in this flow. |
| SubStatus | TransactionSubStatus | The sub status of the flow, which is the substatus of the latest transaction in this flow. |
| Type | TransactionType | The type of flow. Which is the type of latest transaction in this flow. |
| SubType | TransactionSubType | The subtype of the flow, which is the subtype of the latest transaction in this flow. |
| Disputed | bool? | A flow can be disputed by the user. |
| Timestamp | datetime2 | Timestamp of the first transaction in this flow. |
| LatestTimestamp | datetime2 | Timestamp of the latest transaction in this flow. |
Transaction¶
A Transaction. 1 or more transactions make up one TransactionFlow. Each step in the lifetime of a TransactionFlow is separate transactions, i.e Auth, Completion, Settle.
This is what is shown in the Hydra transaction list.
| Name | Type | Desc |
|---|---|---|
| TransactionId | guid | PK. |
| ExternalTransactionId | nvarchar(250) | |
| CardId | guid? | |
| Amount | money | |
| Currency | nvarchar(3)?! | |
| Timestamp | datetime2 | The time of the transaction. |
| Type | TransactionType | The type of transaction |
| SubType | TransactionSubType | The subtype of the transaction |
| Status | TransactionStatus | The status |
| SubStatus | TransactionSubStatus | Substatus. Used internally in Transactions. |
| OriginalTransactionId | guid? | Optional reference to an earlier transaction in the same flow. |
| TransactionFlowId | guid | Reference to the Transaction Flow that this transaction belongs to. |
| TransactionStepType | TransactionStepType | What "step" this transaction is in. |
Enums¶
- AccountType Type of account, i.e.
CheckingPrimary,CheckingPocketorCreditSecured. - TransactionType Type of transaction, i.e.
PosPurchase,CheckDepositorAdminDebit. - TransactionSubType Subtype of transaction, i.e
MerchantCredit,MajorityPaySender, orAccountBalanceRefund. - TransactionStepType Step that this transaction represents, i.e
Auth,Reversal,CompletionorSettlement. - TransactionStatus Status of transaction, i.e
Approved,DeclinedorCancelled - TransactionSubStatus Substatus, i.e
UserCancelled,RequestDeclinedorSystemError. - BlockedStatus Note that this is a flag enum, that can store multiple blocks. Examples
BlockedByUser,BlockedByAdminandLostOrStolen.