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.

Metadata

  • Base Table Class: Static
  • Default Size: Account = 500

Fields

NameTypeSize (bytes)Description
IdInteger (signed)8The unique identifier of this ExternalAccount.
StatusSet of Status4
ExternalAccountProviderForeign key to ExternalAccountProvider8The ExternalAccountProvider represents the authority that issued this ExternalAccount, i.e. a registry or a bank.
ExternalAccountCodeString40
ExternalFKInteger (unsigned)8FK for this record in external system that generated it
FirmForeign key to Firm8A Firm is the organisational unit into which users of the Trading System are grouped. Every Firm belongs to one Enterprise.
AccountForeign key to Account8The 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.
UpdateNumberInteger (unsigned)8A 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.
OwnerUserForeign key to User8The Id of the User that owns this ExternalAccount.
OwnerGroupForeign key to Group8The Id of the Group that owns this ExternalAccount.
OwnerFirmForeign key to Firm8The Id of the Firm that owns this ExternalAccount.
CreateUserForeign key to User8The Id of the User that created this ExternalAccount.
CreateTimestampInteger (unsigned)8The time at which this ExternalAccount was created.
UpdateUserForeign key to User8The Id of the User that last updated this ExternalAccount.
UpdateTimestampInteger (unsigned)8The 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"