Functional contract

Organization structure

Tenants are Organizations. Physical clinics are Locations. Fiscal identity is a Legal Entity, independent of Location. Founder register provisions placeholders. Staff Settings CRUD for Legal Entities and Locations ships.

Founder provision, Settings CRUD, and Location switcher shipped Geocoding not built
Do not model Location as the legal or billing identity. A group can mix sites that share an EIN with acquired or franchise sites that keep their own.

Hierarchy

Organization (tenant / holding) ├── Legal Entity 1 (EIN, legal name, bank, fiscal address, merchant account) │ ├── Location A (clinic downtown) │ └── Location B (clinic north) └── Legal Entity 2 └── Location C (franchise / own EIN)
LevelWhat it isOwns
OrganizationCustomer account and brand umbrellaStaff memberships, master catalog, clients and pets, plan, Location grants
Legal EntityTax/legal person (EIN / tax ID)Invoices, merchant account, POs, tax config, accounting export
LocationPhysical siteHours, rooms, appointments, on-hand stock, cash drawer, card terminals
StaffMembership of a User in an OrganizationRole assignments; founder gets org-wide Organization administrator

Same-EIN groups, independent-EIN franchises, and mixed MSO / post-acquisition groups are all valid. Adding a newly acquired clinic means attaching a Location, and a new Legal Entity only when that clinic keeps its own tax identity.

Data domains

DomainLevelBehavior
Clients and petsOrganizationOne medical chart per patient, visible from every Location
Master catalogOrganizationOne list of services and products; Locations inherit and may override
Inventory on handLocationA sale at A decrements A, never B
Purchase ordersLegal EntityPOs in the name of the EIN; one PO may supply several Locations of that entity
AppointmentsLocationSlots depend on rooms, equipment, and staff at that site
InvoicesHybridFiscal header from Location’s Legal Entity; sale attributed to the Location
Cash drawer / terminalsLocationEach site closes its own drawer
Merchant account / payoutsLegal EntityCard proceeds settle to that entity’s bank
Financial reportsAll threeOrg view, tax view per entity, operational view per Location

Workspace context

Staff work inside one Organization and one current Location.

A SuperUser may select any Organization, then any Location in it. Record how current Location is stored (session, header, or URL) in architecture when implemented.

Clients and pets

Client and pet records are Organization-scoped. A pet that visits Location A and later Location C keeps one chart.

Financial balances are not global:

Plan implications

The data model allows 1..N Legal Entities. Plan caps and Settings UX follow the tier:

PlanLegal EntitiesLocations UX
Starter / BusinessExactly one; fields edited on Settings → Organization (1–1)Listed under the Organization; no Legal Entity picker
EliteUnlimited; Settings → Legal Entities CRUDMay assign Locations to a Legal Entity

Acceptance (when built)

Out of scope here: payment-processor onboarding, accounting-export field maps. Appointment booking and SOAP UX are defined in their own functional pages.