3.1 KiB
3.1 KiB
Zones Of Regulation Integration
Purpose
ZonesOfRegulation renders backend-owned regulation zone content through the three-layer frontend architecture.
View -> Business Logic -> API/Data Access -> Backend
Runtime zone records, behaviors, strategies, matching signs, and safety connections belong to backend content catalog payloads. The frontend owns UI state, tab config, style-token mappings, presentation, and the static Quick Behavior Management Flow block.
Frontend Layers
View:
frontend/src/components/frameworks/ZonesOfRegulation.tsxfrontend/src/components/zones-of-regulation/ZonesOfRegulationView.tsxfrontend/src/components/zones-of-regulation/ZonesHeader.tsxfrontend/src/components/zones-of-regulation/ZonesTabs.tsxfrontend/src/components/zones-of-regulation/ZonesOverviewGrid.tsxfrontend/src/components/zones-of-regulation/ZoneOverviewCard.tsxfrontend/src/components/zones-of-regulation/ZoneDetailPanel.tsxfrontend/src/components/zones-of-regulation/ZoneDetailListPanel.tsxfrontend/src/components/zones-of-regulation/ZoneSignsPanel.tsxfrontend/src/components/zones-of-regulation/ZoneSafetyConnectionPanel.tsxfrontend/src/components/zones-of-regulation/ZonesQuickFlow.tsx
Business logic:
frontend/src/business/zones/hooks.tsfrontend/src/business/zones/selectors.tsfrontend/src/business/zones/types.ts
Shared contracts and UI config:
frontend/src/shared/types/app.tsfrontend/src/shared/constants/zonesOfRegulation.tsfrontend/src/shared/constants/contentCatalog.ts
Backend Contracts
The page reads:
GET /api/content-catalog/read/regulation-zonesGET /api/content-catalog/read/zones-of-regulation-page-content
Content payloads are seeded in:
backend/src/db/seeders/content-catalog-data/content-catalog-seed-payloads.ts
Behavior
useZonesOfRegulationPageloads zone records and page-level content.- Selectors handle expanded-zone toggling, selected-zone lookup, safety connection lookup, and active-tab wording.
- View components receive a prepared page model and do not call API/data access modules.
- Loading and error states are explicit through
StatePanel. - Selecting a zone in the main overview grid expands its details and, for eligible users in their own scope, saves the daily Zone check-in through
useTodayZoneCheckIn. The page does not render a duplicate check-in card above the content; seezone-checkin-integration.md. ZonesQuickFlowrenders the static Quick Behavior Management Flow. This copy and styling are not editable content catalog data.- New organizations receive
regulation-zonesandzones-of-regulation-page-contentpresets at organization scope. School, campus, and classroom users read the organization preset instead of separate duplicated rows.
Data Ownership Rules
- Do not add zone records or QBS safety connection copy to frontend constants.
- Do not add frontend fallback zone payloads.
- Keep frontend constants limited to tab labels, default UI state, gradients, ring classes, and stable non-editable UI copy.
- Test-only fixtures may live in selector tests or
frontend/src/test-seeds/.