adds logging and policies

This commit is contained in:
2026-02-03 11:47:08 +01:00
parent 9583b7030c
commit c693cde038
23 changed files with 2151 additions and 16 deletions

View File

@@ -366,7 +366,7 @@ ## Step 10: Scoring and Result
## Step 11: Activity Logging
[ ] **Add append-only activity logging for analytics.**
[x] **Add append-only activity logging for analytics.**
Create a logging service (or helper) that writes to the `logs` table. Integrate log writes into all relevant actions: `login`, `logout`, `screening_started`, `screening_completed`, `session_started`, `session_completed`, `session_abandoned`, `answer_saved`, `step_viewed`. Each log includes `user_id`, `session_id`, `category_id`, `action`, and `metadata` JSON as defined in `docs/technical-requirements.md` section 5 (logs table). The Log model should have no `updated_at` and should prevent updates/deletes.
@@ -403,7 +403,7 @@ ## Step 11: Activity Logging
## Step 12: Nova Resources and Policies
[ ] **Create all Nova resources, policies, and Excel export actions.**
[x] **Create all Nova resources, policies, and Excel export actions.**
Create Nova resources: `CategoryResource`, `QuestionGroupResource`, `QuestionResource`, `ScreeningResource`, `SessionResource`, `AnswerResource`, `LogResource`. Create corresponding policies enforcing the permission matrix from `docs/technical-requirements.md` section 9 (most are read-only; only Question.text is editable). Apply field behaviors: all fields filterable, sortable, and copyable where applicable. Set menu visibility (only Question, Screening, Session, Log appear in sidebar). Install `maatwebsite/laravel-nova-excel` and add `DownloadExcel` action to every resource.