Skip to main content

Data Model

Source: equa-server/modules/persistence/src/schema.ts (lines 1-2101) Entity count: 92 entities (90 tables + 2 view entities) Database: PostgreSQL

Domain Partitioning

Source: Confluence KnowledgeBase — Entity Domain Partitioning (by Christopher Johnson)
There are two main entity types: Individuals and Organizations. Intrinsic data is partitioned across domains:
DomainApplies ToPurposeSample Data
ProfileIndividuals + OrganizationsIdentity and appearance in relation to other entitiesFull name, contact info, avatar, government registration
AccountIndividuals + OrganizationsBusiness relationship between entity and EquaBilling info, Equa Cash balance, paid feature config
Site AccessIndividuals onlyAuthentication, authorization, usage trackingUsername, email, password, enabled/disabled status
Organizations do not have Site Access data — the site is only accessed through individuals. Database schema mapping:
  • Organizations: All intrinsic data stored in the organizations table (the deprecated organization_details table previously stored profile data)
  • Individuals: users table (access data), profiles table (profile data, may be renamed to user_profiles), and a planned user_accounts table for account data
Multi-tenancy is achieved through organization foreign keys on business entities. Cross-domain references use standard TypeORM @ManyToOne / @OneToMany relations.

Entity Summary by Domain

Users and Authentication (10 entities)

EntityTableKey Fields
Usersusersid (uuid), email (citext, unique), username, passwordHash, twoFactorSecret, enabled, twoFactorEnabled, emailVerified, acceptedTerms
Sessionssessionsid, expires (indexed), user (uuid, indexed), json (text)
Profilesprofilesid (uuid), fullName, email, dateOfBirth, phone, website, links (jsonb)
UserAccountsuser_accountsid (uuid), pin
UserStatesuser_statesuser (uuid), data (jsonb)
TempPasswordstemp_passwordsuser (uuid), passwordHash
EmailVerificationsemail_verificationsuser (uuid), code
Onetimecodesonetimecodesuser (uuid), code, available
RegistrationMetadataregistration_metadatauser (uuid), value (jsonb)
GlobalRolesUsersglobal_roles_usersuser (uuid), role (GlobalRole int)

Organizations (7 entities)

EntityTableKey Fields
Organizationsorganizationsid (uuid), name, operatingAgreement (Hash), companyType, equityStructure, creator, website, ein
OrganizationDetailsTableorganization_detailsname, companyType, businessAddress, phoneNumber, registrationNumber, startDate
OrganizationTemplatesorganization_templatesorganization (uuid), type, content (Hash)
Membersmembersid, fullName, email, organization (uuid), user (uuid), isIndividual, title
MemberLimitsmember_limitsorganization, memberLimit
CompaniesInfocompanies_infoid, email, name, phoneNumber, organizationType, user (unique)
Addressesaddressesid, owner (uuid), street1, city, country, postalCode

Cap Table and Securities (14 entities)

EntityTableKey Fields
Shareholdingsshareholdingsmember (uuid), organization (uuid), shares (numeric), securityType (Hash), issueDate, serialNumber, shareholderName
SecurityTypessecurity_typesorganization (uuid), shareClass, shareType, certifiedShares, votingShares, price, name
SecurityDetailssecurity_detailsshareClass, shareType, certifiedShares, fractionalShares, votingShares, sharePricing
SecurityTypeSeniorityTablesecurity_type_senioritysecurityType (Hash), seniority
SecurityTypeSharesTablesecurity_type_sharessecurityType (Hash), shares (numeric), boardApprovalDocument
SharePricingTableshare_pricing_tablepricePerShare, parValue, originalIssuePrice, conversionPrice, conversionRate
Holdingsholdingsentity (uuid), owner, value (numeric), holdingType, name, issueDate, pricePerUnit
CapitalChangescapital_changesmod (numeric), timestamp, type (uuid), organization (uuid)
FundingRoundsfunding_roundsid (uuid), organization, number, endDate, totalCommon, totalPreferred, name
Valuationsvaluationsentity, issueDate, value (numeric), units
Signaturessignaturesid (uuid), shareholding (uuid), signatory (uuid), name, title
Transferstransfersinputs (Hash), outputs (Hash)
TransferOutputstransfer_outputsholding (Hash), owner (uuid), value (numeric)
Legendslegendscontent

ESOP and Vesting (7 entities)

EntityTableKey Fields
Plansplanshash (Hash), organization (uuid), name, boardApprovalDate, termYears, approvedEquities (jsonb)
PlansSecuritiesplans_securitiesplan (Hash), security (Hash)
PlansVestingSchedulesplans_vesting_schedulesplan (Hash), vestingSchedule (Hash)
Poolspoolsorganization (uuid), security (Hash), shares (numeric), pricePerShare, vestingSchedule, name
Optionsoptionsorganization (uuid), security (Hash), member (uuid), shares (numeric), startDate, vestingSchedule
ContinuousVestingSchedulescontinuous_vesting_schedulesdurationMonths, frequencyMonths, cliffMonths, cliffAmount
DiscreteVestingSchedulesdiscrete_vesting_schedulesevents (Hash), entity (uuid), name

Convertible Instruments (4 entities)

EntityTableKey Fields
ConvertibleInstrumentsconvertible_instrumentsauthorizedRaiseAmount, instrumentType, interestRate, maturityDate, valuationMax, conversionDiscount
InstrumentConversionsinstrument_conversionsconvertibleInstrument (Hash), shares, valuation
NoteConversionsnote_conversionsconversion, source, destination, sharesOwed, value
RepaymentsrepaymentsconvertibleInstrument (Hash), issueDate

Agreements and Documents (5 entities)

EntityTableKey Fields
OperatingAgreementsoperating_agreementsorganization (uuid), timestamp, organizationDetails, plans, shareholdings
OperatingAgreementsShareholdingsoperating_agreements_shareholdingsoperatingAgreement (Hash), shareholding (Hash)
Authorizationsauthorizationsorganization (uuid), target, authorizationDate, document, note
LegendMetaslegends_metalegend (Hash), organization (uuid), name, author (uuid)
RegisteredAgentsregistered_agentsid (uuid), name, address, type (AgentType)

Files and Data Room (4 entities)

EntityTableKey Fields
Filesfilesid (uuid), hash, filename, url, extension, contentType, size, owner (uuid)
HashedFileshashed_fileshash (Hash), size
DirectoryItemsdirectory_itemsorganization (uuid), parentPath, name, type, file (uuid), size
DataRoomsMembersdata_rooms_membersdataRoomName, member (uuid), permission (uuid)

Google Drive Integration (4 entities)

EntityTableKey Fields
GoogleDriveConnectionsgoogle_drive_connectionsid (uuid), organization, accessToken, refreshToken, googleEmail, isActive
GoogleDriveSyncConfigurationsgoogle_drive_sync_configurationsid (uuid), organization, googleFolderId, targetDataRoomPath, syncEnabled
GoogleDriveSyncHistorygoogle_drive_sync_historyid (uuid), organization, status, filesProcessed, filesAdded, filesUpdated
GoogleDriveSyncedFilesgoogle_drive_synced_filesid (uuid), googleFileId, localFileId, dataRoomPath, syncStatus

Roles and Permissions (5 entities)

EntityTableKey Fields
Rolesrolesid (uuid), name, description, owner (uuid), isShared
Permissionspermissionsid (uuid), name
PermissionsRolespermissions_rolespermission (uuid), role (uuid)
MembersRolesmembers_rolesmember (uuid), role (uuid)
OrganizationsRolesorganizations_rolesorganization (uuid), role (uuid)

Referrals and Rewards (4 entities)

EntityTableKey Fields
Referralsreferralsid, user (uuid), referralLink, equaCash (numeric), noOfReferrals, status
Rewardsrewardsid, reward (number), type (RewardType), scratched, user (uuid), organization (uuid)
Invitationsinvitationsid, email (citext), user (uuid), organization (uuid), status (InviteStatus)
UserCouponsuser_couponsuser (uuid), code

Financial and Blockchain (5 entities)

EntityTableKey Fields
Transactionstransactionsfrom, to, value (numeric), currency, currencyType, fromType, toType
BankAccountsbank_accountsid (uuid), accountNumber, registeredNumber, bankName
TaxIdstax_idsorganization (uuid), name, value
WalletAddresseswallet_addressesaddress (Hash), entity (Hash), globalName, name
UserRavenAddressesuser_raven_addressesuser (uuid), address (Hash)

Activity and Audit (3 entities)

EntityTableKey Fields
Actionsactionsorganization (uuid), type (uuid), user (uuid)
EventLogsevent_logsid (uuid), type, user (uuid), organization (uuid), data (json)
Taskstasksentity (uuid), type (TaskType), status (TaskStatus)

Other (8 entities)

EntityTableKey Fields
Colorscolorsuser (uuid), target, value
Waitlistswait_listsid, user (uuid), position
DomainBlacklistsdomain_blacklistsid (uuid), domain
EmailBlacklistsemail_blacklistsid (uuid), email (citext)
DeletedRecordsdeleted_recordskey
ImportRowsimport_rowsid (uuid), member, organization, holding, file
VestingEventsvesting_eventsday, month, year, value (numeric)
TasksExerciseOptiontasks_exercise_optionid (uuid), option (Hash), shares (numeric)

View Entities (2)

EntityTableExpression
GroupsView on rolesSELECT * FROM roles
OperatingAgreementsTransactionsViewRecursive CTE joining operating_agreements and hash_lists

Entities in allEntities Not Yet Documented Above

The following 10 entities exist in schema.ts allEntities array but are not categorized in the domain tables above:
EntityBase ClassPurpose
BlocksHashedTableBlockchain/hash block tracking
BranchesCreatedModifiedDeletedEntity branch/version tracking
ChangesHashedTableChange/diff tracking
DividendConfigsHashedTableDividend configuration
EntitiesGroupsCreatedModifiedDeletedEntity-to-group associations
EntityAddressesCreatedModifiedDeletedEntity physical addresses
EntityEmailsCreatedModifiedDeletedEntity email addresses
HashedAddressesHashedTableHashed address records
HashListsCreatedOrdered hash list entries
SerialHashedTableHashedTableAbstract base class for serial-keyed hashed tables

Base Classes

All entities extend one of these base classes which provide common fields:
Base ClassFields Provided
HashedTablehash (Hash, primary key)
Createdcreated (timestamp)
CreatedModifiedcreated, modified (timestamps)
CreatedModifiedDeletedcreated, modified, deleted (timestamps)

Indexes

EntityColumnType
SessionsexpiresIndex
SessionsuserIndex

Unique Constraints

EntityColumn
Usersemail
CompaniesInfouser