Backend: Form – Grupna diskusija
Last modified with commit e90a924 on
by Aljaž.
Backend task for the Grupna diskusija form (activity group-discussion) – check the criterion keys, notes and status rule against the API spec and DB structure, implement, and verify.
Docs: Form – Grupna diskusija
Spec: activity group-discussion on /assessments/{assessmentId}/forms/{activity} in api-docs/openapi.yaml
DB: AssessmentGrades (group-discussion), AssessmentNotes (group-discussion, fieldKey notes) in api/database/create_schema.sql
A shared form: all candidates in one table, plus one Bilješke note per candidate.
1. Double check API spec and DB structure
- Criterion keys for the 5 categories / 12 sub-criteria in the docs:
- Pojava / ponašanje – 3
- Društvenost / Empatija – 2
- Govorne sposobnosti – 3
- Sposobnost uvjeravanja / Upornost – 2
- Posvećenost / samo-motiviranost – 2
- Agree on the category keys (e.g.
pojava-ponasanje,drustvenost-empatija, …) and add them to the spec or the shared contract (see Backend: Assessment forms). - Bilješke: one optional note per candidate,
fieldKey = "notes". It doesn’t affect the status. Check the spec description. - Status rule: Zaključeno when, for every candidate, every category has at least one sub-criterion filled in.
- Roles and permissions: Trainer and Assessment evaluator, if they are active board members.
- DB: both check constraints allow
group-discussion(grades and notes).
2. Implementation
- Roles and permissions: handled by the shared form endpoint. No extra checks.
- DB / catalog: add the group-discussion criteria and the
notesfield to the catalog. - Status helper for this form (used by detail, forms and results).
- POGODNOST per candidate = the average of the categories.
3. Verify implementation against spec
- Every category filled in for all candidates →
isCompleted: true; one candidate missing a category →false. - Notes are stored and returned, and don’t change the status.
- Unknown criterion key → 400.
Done when
Grupna diskusija can be filled in and saved, and its status and POGODNOST are correct.