Backend: Form – Strukturirani intervju – bilješke
GitHub Issue: #224
Last modified with commit 7a580a0 on
by Aljaž.
Backend task for the trainer-only Strukturirani intervju – bilješke notes form (activity interview-notes) – check the field keys, privacy and status rule against the API spec and DB structure, implement, and verify.
Docs: Form – Strukturirani intervju – bilješke
Spec: activity interview-notes on /assessments/{assessmentId}/forms/{activity} (candidateId required, assessments.notes-access) in api-docs/openapi.yaml
DB: AssessmentNotes (interview-notes, fieldKey p<page>.<n>) in api/database/create_schema.sql
An individual notes form for the Trainer only, across 6 pages with 21 fields. The notes are private and not shown anywhere else.
1. Double check API spec and DB structure
- Field keys for the 21 fields (1 + 5 + 4 + 5 + 5 + 1), page by page:
- page 1:
p1.1 - page 2:
p2.1–p2.5 - page 3:
p3.1–p3.4 - page 4:
p4.1–p4.5 - page 5:
p5.1–p5.5 - page 6:
p6.1Check the counts against each page in the docs.
- page 1:
- Privacy: these notes must never appear on the Bilješke endpoint or in the results. Each trainer sees only their own.
- Moving between pages doesn’t save (docs recommendation). The whole form is saved at once with “Spremi”. Check the spec allows one save with all pages.
- Status rule: Zaključeno when all 21 fields are filled in.
- Roles and permissions: requires
assessments.notes-access(Trainer) and active board member. An Assessment evaluator gets 403, and the activity is hidden from them on the detail page. - DB: the AssessmentNotes check constraint allows
interview-notes;FieldKey NVARCHAR(50)fitsp<page>.<n>.
2. Implementation
- Roles and permissions: check
assessments.notes-accessin the forms endpoint (→ 403) and on the detail page (activity not returned). - DB / catalog: add the interview-notes fields to the catalog. The aggregated notes
query must never select
interview-notes. - Status helper for this form.
3. Verify implementation against spec
- Evaluator token → 403 on GET and POST.
- 20 fields filled in →
false; 21 →true. - Trainer A cannot see trainer B’s notes.
Done when
Trainers can fill in their private interview notes, and nobody else can read them.