Admin
Office Locations
| Path | /office-locations |
|---|---|
| Status | live |
| Drill-down pages | — |
| Pop-ups | Operatories row expand |
| Tabs | — |
| API routes | /api/office-locations/api/office-locations/:officeId/chairs/api/office-locations/sync |
Business rules
Data comes from: dentrix_offices (one row per office per app: schedule = the 11 field units, appointment = the 3 practices; the id is Dentrix's location id) and operatories (chairs). Both are filled by the location sync: the Sync from Dentrix button and the cron twice a day. Access: Office Locations, checked on the server.
How it works:
- Every office list, filter and label in Pulse reads these rows (
useOffices, workerlib/office-filter.ts); the Type column is what decides a report's office scope (all / field units / 3 practices). - Chairs (row expand) come from the
operatoriestable, in chair-number order (the order bookings fill chairs), with Dentrix's Name (API short name), Description (API name), Status and ID. The time they were last synced is shown. - Chairs column: active chairs (hover: total in Dentrix).
- Sync from Dentrix: offices + every office's chairs (about 15 Dentrix calls). New field units are added; a new office that is not a field unit is skipped and counted. A chair that fails is listed in a warning; the rest still update.
Database tables & columns
| Table | Columns used |
|---|---|
dentrix_offices | active, address, app, city, dentrix_id, display_name, id, name, phone, postal_code, state, timezone |
operatories | active, app, dentrix_id, id, name, office_id, short_name, use_for_booking |
File structure
Its own files
- apps/
- web/
- src/
- features/
- office-locations/
- pages/
- OfficeLocationsPage.tsx
- api.ts
- index.ts
- pages/
- office-locations/
- features/
- src/
- worker/
- src/
- features/
- office-locations/
- __tests__/
- service.test.ts
- index.ts
- queries.ts
- routes.ts
- service.ts
- __tests__/
- office-locations/
- features/
- src/
- web/
Shared code it uses (followed through its imports and the helpers its API calls; sign-in/access plumbing and UI primitives left out)
- apps/
- web/
- src/
- components/
- reports/
- DentrixSourceNote.tsx
- HowItWorksNote.tsx
- ReportHeader.tsx
- reports/
- services/
- api.ts
- components/
- src/
- worker/
- src/
- routes/
- dentrix.ts
- utils/
- office.ts
- routes/
- src/
- web/