Functional contract

Organization structure

Tenants are Organizations. Physical clinics are Locations. Fiscal identity is a Legal Entity, independent of Location. Location Groups (Elite) are an optional operational cluster. Founder register provisions placeholders; Settings CRUD for Legal Entities, Locations, and Location Groups ships.

Founder provision, Settings CRUD, Location switcher shipped Location Groups (Elite), hours, resources shipped Geocoding and Customer onboarding not built Updated 3 Nov 2026
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)

Operational grouping is a separate, optional axis (Elite):

Organization ├── Location Group "North region" ── Location A, Location C └── (no group) ── Location B
LevelWhat it isOwns
OrganizationCustomer account and brand umbrellaStaff memberships, master catalog, pricing groups, clients and pets, plan, Location grants, default logos and brand colors
Legal EntityTax/legal person (EIN / tax ID)Invoices, merchant account, POs, tax config, accounting export, currency
Location GroupOptional cluster of Locations (region, brand, franchise network)Group catalog grants; catalog, price, patient group, and tax overrides and locks; group patient groups, taxes, tax groups, and commission groups
LocationPhysical siteHours, rooms and equipment, appointments, on-hand stock, cash drawer, card terminals, optional logo/color overrides
StaffMembership of a User in an OrganizationRole assignments; founder gets org-wide Organization administrator

Location Groups

Rules

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

Data domains

DomainLevelBehavior
Clients and petsOrganizationOne medical chart per patient, visible from every Location
Master catalogOrganizationOne list; groups and Locations inherit and may override as allowed
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, stored in the Rails session.

A SuperUser may select any Organization, then any Location in it.

Clients and pets

Client and pet records are Organization-scoped (Patients). A pet that visits A and later C keeps one chart. Financial balances are not global:

Plan implications

PlanLegal EntitiesLocations UXLocation Groups
Starter / Business (and trial without Elite)Exactly one; edited on Settings → Organization; tab hiddenListed under the Organization; no Legal Entity pickerNot available
EliteUnlimited; Settings → Legal Entities CRUDMay assign Locations to a Legal Entity; structure map Org → Legal Entity → LocationsSettings → Location groups

Downgrading from Elite is blocked while extra Legal Entities or any Location Group remain.

Opening hours

Each Location has weekly hours and date exceptions, edited on the ficha (and /app/locations/new) by staff who may_manage_location?. Appointments are not rejected outside hours.

RecordWhat it is
LocationHourWeekly open interval. weekday ISO 1–7 (Monday = 1); times in Location time_zone. Several per day allowed; no overnight
LocationHourExceptionA date that replaces weekly hours: closed, or custom intervals
LocationHourExceptionIntervalCustom interval on a non-closed exception

Rooms and equipment

Each Location has LocationResource rows (kind room or equipment), edited on the ficha. Appointments may book zero or more (Appointments).

Field / ruleBehavior
nameRequired; unique within the Location, including the waiting room name
availableDefault true; mark false when out of service
occupancy_limitPositive integer (default 1)
Waiting roomLocation#waiting_room_name (“Waiting Room” / “Sala de espera”), not a resource; first row, renamable, not removable
BookingUnavailable resource or over occupancy limit confirms and still saves
Whiteboard FloorColumns are rooms plus the waiting room; equipment never (Visits)
Schedule/app/schedule?view=resource: one swimlane per room or equipment; waiting room excluded

Acceptance

Out of scope: payment-processor onboarding, accounting-export field maps, rejecting appointments outside hours, overnight intervals, staff-specific hours, mobile editors.