Skip to content

feat: add trainee self reflection API (T-313) - #5

Merged
xfoxfu merged 3 commits into
mainfrom
codex/t-313-self-reflection
Sep 24, 2026
Merged

xfoxfu merged 3 commits into
mainfrom
codex/t-313-self-reflection

Conversation

@xfoxfu

@xfoxfu xfoxfu commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Add configurable trainee self-reflection to training records. Seed a training-self-reflection sheet with one free-text field, expose its active fields, and return submitted answers with the existing training DTO.

The trainee or a user with controller-training-director-assistant permission can save or edit the reflection at any time. Reading follows existing training-record permissions, including other mentors. The sheet endpoint is scoped to the training ID and uses the same visibility check; training DTOs return reflection answers without additional filtering. Existing role inheritance applies. Saves reuse the sheet filing in a transaction with a training-row lock, including concurrent first submissions.

Validation

  • 8 API tests passed, covering field configuration, create/edit/read, access control, concurrent submissions, invalid-answer rollback, and existing training endpoints.
  • Compiled backend and generated OpenAPI types.
  • Applied the new migration successfully to an isolated PostgreSQL database.

Deployment

Apply 20260921000000_add_training_self_reflection.sql before deploying the API and the companion frontend change. Staff can configure the sheet through the existing sheet management system.

Implements T-313. Mentor feedback revision history (T-314) is outside this change.

Companion frontend: VATPRChina/vatprc-docs#84.

@linear-code

linear-code Bot commented Sep 24, 2026

Copy link
Copy Markdown

T-313

@xfoxfu
xfoxfu marked this pull request as ready for review September 24, 2026 10:43
@xfoxfu
xfoxfu merged commit b2bddfe into main Sep 24, 2026
2 checks passed
@xfoxfu
xfoxfu deleted the codex/t-313-self-reflection branch September 24, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant