40227-vm/frontend/docs/staff-attendance-integration.md
Dmitri d4a5378adf Refactor: migrate frontend to Vite/React, add product backend modules
Frontend:
- Replace Next.js with Vite + React + TypeScript
- Add new component architecture (app-shell, sidebar, dashboard modules)
- Implement product modules: FRAME, safety protocols, walkthrough checkin,
  campus/staff attendance, personality quiz, sign language, classroom timer
- Add shadcn/ui component library with Tailwind CSS
- Remove legacy generated components, stores, and pages

Backend:
- Add product migrations: frame_entries, user_progress, safety_quiz_results,
  walkthrough_checkins, communication_events, personality_quiz_results,
  campus_attendance_config/summaries, staff_attendance_records, content_catalog
- Add corresponding models, services, and routes
- Implement cookie-based auth with refresh token rotation
- Add content catalog seeder with product content
- Migrate to ESLint flat config
- Switch from yarn to npm

Infrastructure:
- Update .gitignore for new tooling
- Add project documentation (CLAUDE.md, docs/)
- Remove deprecated config files and yarn.lock

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-06-09 15:18:23 +02:00

48 lines
1.7 KiB
Markdown

# Staff Attendance Frontend Integration
## Purpose
Staff attendance snapshot and director dashboard staff counts follow the frontend three-layer architecture.
```text
View -> Business Logic -> API/Data Access -> Backend
```
## Files
View layer:
- `frontend/src/components/staff-attendance/AttendanceModule.tsx`
- `frontend/src/components/frameworks/MoreModules.tsx` as a module export hub
- `frontend/src/components/frameworks/DirectorDashboard.tsx`
- `frontend/src/components/director-dashboard/DirectorOverviewCards.tsx`
- `frontend/src/components/director-dashboard/DirectorRiskList.tsx`
Business logic layer:
- `frontend/src/business/staff-attendance/hooks.ts`
- `frontend/src/business/staff-attendance/mappers.ts`
- `frontend/src/business/staff-attendance/selectors.ts`
- `frontend/src/business/staff-attendance/types.ts`
- `frontend/src/business/director-dashboard/hooks.ts`
- `frontend/src/business/director-dashboard/selectors.ts`
API/data access layer:
- `frontend/src/shared/api/staffAttendance.ts`
- `frontend/src/shared/types/staffAttendance.ts`
- `frontend/src/shared/constants/staffAttendance.ts`
## Behavior
- Staff attendance records load from `GET /api/staff_attendance/records`.
- Staff attendance summary loads from `GET /api/staff_attendance/summary`.
- Regular staff receive their own records from the backend.
- Director dashboard receives scoped report records and active staff count from the backend.
- Attendance UI uses shared table and status panel primitives while keeping data loading in the business layer.
- Director dashboard derives attendance metrics and absence risk rows in business selectors.
## Remaining Related Work
Add staff attendance import/write UI only after the external attendance source contract is defined.