ExternalAccount
An ExternalAccount represents a account for whom the authority is outside of MarketGrid: for example, an account with a share registry or a bank.
In the data model, Accounts own ExternalAccounts, and ExternalAccounts own Holdings.
Each ExternalAccount is associated with one ExternalAccountProvider.
- Section: Position Keeping
Metadata
- Base Table Class: Static
- Default Size: Account = 500
Fields
| Name | Type | Size (bytes) | Description |
|---|---|---|---|
| Id | Integer (signed) | 8 | The unique identifier of this ExternalAccount. |
| Status | Set of Status | 4 | |
| ExternalAccountProvider | Foreign key to ExternalAccountProvider | 8 | The ExternalAccountProvider represents the authority that issued this ExternalAccount, i.e. a registry or a bank. |
| ExternalAccountCode | String | 40 | |
| ExternalFK | Integer (unsigned) | 8 | FK for this record in external system that generated it |
| Firm | Foreign key to Firm | 8 | A Firm is the organisational unit into which users of the Trading System are grouped. Every Firm belongs to one Enterprise. |
| Account | Foreign key to Account | 8 | The Account to which this ExternalAccount belongs. Note that each Account may only be associated with each ExternalAccountProvider at most once. It is an error for an Account to have multiple ExternalAccounts for the same ExternalAccountProvider. |
| UpdateNumber | Integer (unsigned) | 8 | A number that records every change that happens to a record. It is primarily used to avoid write after read problems when an intermediate write has changed the originally read record. |
| OwnerUser | Foreign key to User | 8 | The Id of the User that owns this ExternalAccount. |
| OwnerGroup | Foreign key to Group | 8 | The Id of the Group that owns this ExternalAccount. |
| OwnerFirm | Foreign key to Firm | 8 | The Id of the Firm that owns this ExternalAccount. |
| CreateUser | Foreign key to User | 8 | The Id of the User that created this ExternalAccount. |
| CreateTimestamp | Integer (unsigned) | 8 | The time at which this ExternalAccount was created. |
| UpdateUser | Foreign key to User | 8 | The Id of the User that last updated this ExternalAccount. |
| UpdateTimestamp | Integer (unsigned) | 8 | The time at which this ExternalAccount was last updated. |
Foreign Keys
The following diagram shows the tables that have a foreign key link to the ExternalAccount table. All Table nodes can be clicked to take you to that table's definition page.
graph LR; AccountLink-->|ExternalAccount|ExternalAccount click AccountLink "/marketgrid/developer/model/tables/AccountLink" BankAccount-->|ExternalAccount|ExternalAccount click BankAccount "/marketgrid/developer/model/tables/BankAccount" RegistryAccount-->|ExternalAccount|ExternalAccount click RegistryAccount "/marketgrid/developer/model/tables/RegistryAccount" Holding-->|ExternalAccount|ExternalAccount click Holding "/marketgrid/developer/model/tables/Holding" HoldingTransaction-->|ExternalAccount|ExternalAccount click HoldingTransaction "/marketgrid/developer/model/tables/HoldingTransaction" BankTransaction-->|ExternalAccount|ExternalAccount click BankTransaction "/marketgrid/developer/model/tables/BankTransaction"