Data model
This page records schema rules that are easy to miss when reading only the entity and API names.
Core entities and link tables
PROVIDERstores the provider firm or practitioner record.OFFICEstores the reusable office record, such as address, contact, and DX details.PROVIDER_OFFICE_LINKstores the provider-specific relationship to an office.- API-facing office identifiers usually refer to the link record, not the underlying office record.
- This means the same
OFFICErecord can have different meaning depending on whichPROVIDER_OFFICE_LINKrow is being used.
Office identifiers
OFFICE.GUIDidentifies the underlying office record.PROVIDER_OFFICE_LINK.GUIDidentifies the association between a provider and an office.- In most API request and response fields,
officeGUIDmeansPROVIDER_OFFICE_LINK.GUID, notOFFICE.GUID. OFFICE.GUIDis mainly used internally when creating an office record and linking it to aProviderOfficeLinkEntity.
Office manager link tables
OFFICE_CONTRACT_MANAGER_LINK.OFFICE_GUIDis a foreign key toPROVIDER_OFFICE_LINK.GUID.OFFICE_LIAISON_MANAGER_LINK.OFFICE_GUIDis a foreign key toPROVIDER_OFFICE_LINK.GUID.- These columns do not point to
OFFICE.GUID, despite the column name. - In JPA, both tables therefore map
OFFICE_GUIDtoProviderOfficeLinkEntity officeLink.
Provider office links
PROVIDER_OFFICE_LINKis the main join table between providers and offices.PROVIDER_OFFICE_LINK.ACCOUNT_NUMBERis the office code used in API requests alongside the provider-office-link GUID.HEAD_OFFICE_FLAGis stored on the link, not on the office.- For advocates, the linked office record is a Chambers office, but the advocate still has its own provider-office-link row.
Provider office link inheritance
PROVIDER_OFFICE_LINKuses single-table inheritance withFIRM_TYPEas the discriminator.LspProviderOfficeLinkEntity,ChamberProviderOfficeLinkEntity, andAdvocateProviderOfficeLinkEntityall map to the same table.- Some columns are only meaningful for certain firm types, but they still exist physically for all rows in the table.
- Required rules for type-specific fields are therefore mainly enforced in service logic and
request validation rather than by
NOT NULLconstraints.
Parent provider relationships
PROVIDER_PARENT_LINKlinks a provider to a parent provider.- This table is currently used for advocates and their parent Chambers.
- Parent-child relationships are separate from office links and should not be inferred only from
OFFICEorPROVIDER_OFFICE_LINK.
Bank account links
BANK_ACCOUNTstores the reusable bank account details.PROVIDER_BANK_ACCOUNT_LINKlinks a bank account directly to a provider.OFFICE_BANK_ACCOUNT_LINKlinks a bank account to aPROVIDER_OFFICE_LINK, not toOFFICE.- Office-level payment data is therefore attached to the provider-office-link layer.
OFFICE_BANK_ACCOUNT_LINK.PRIMARY_FLAGidentifies the current primary office bank account, with older links retained as historical records.
Practical implications
- Resolve
officeGUIDorCodeusingProviderOfficeLinkEntity.guidorProviderOfficeLinkEntity.accountNumber. - When naming repository or service methods, prefer names that make the provider-office-link semantics explicit.
- Avoid using
OfficeEntity.guidin API-facing identifiers unless an endpoint explicitly documents that behaviour.