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>
33 lines
1.0 KiB
Markdown
33 lines
1.0 KiB
Markdown
# Safety Quiz Results Backend
|
|
|
|
## Purpose
|
|
|
|
`safety_quiz_results` stores weekly de-escalation/QBS quiz submissions per authenticated staff user. The backend owns tenant scope, user ownership, user display name, and role snapshot.
|
|
|
|
## API
|
|
|
|
All routes require JWT authentication.
|
|
|
|
- `GET /api/safety_quiz_results`: returns quiz results visible to the current user.
|
|
- `GET /api/safety_quiz_results?week_of=<week>`: filters visible results by week.
|
|
- `POST /api/safety_quiz_results`: saves one quiz result for the current user.
|
|
|
|
## Access Rules
|
|
|
|
- Staff users can create results for themselves.
|
|
- Staff users can read their own results.
|
|
- Director/superintendent-capable generated roles can read organization-level results for compliance views.
|
|
|
|
## Data Contract
|
|
|
|
Required mutation fields:
|
|
|
|
- `quiz_id`
|
|
- `quiz_title`
|
|
- `week_of`
|
|
- `score`
|
|
- `total_questions`
|
|
- `answers`
|
|
|
|
The frontend does not send user names or roles for ownership. The backend fills `user_name`, `user_role`, `organizationId`, `campusId`, and `userId` from the authenticated user.
|