1.5 KiB
1.5 KiB
Training Record Draft Feature Report
Summary
Implemented the draft workflow for training records based on the existing training-records feature pattern.
Key behavior now supported:
- Employees can save a training record as
draft - Employees can edit their own records only when status is
draftorneeds_revision - Submitting a record moves it to
pending - HRD review can return a record as
needs_revision - The pending review queue is hard-scoped to
pendingrecords only
Main Changes
- Added
draftto theapproval_statusenum in Drizzle schema - Generated migration
drizzle/0014_sweet_nico_minoru.sql - Extended training-record API types and UI label maps to include
draft - Added
submissionModehandling for create/update flows - Reset previous review data when a returned record is re-submitted
- Switched employee edit permission from
pendingtodraft | needs_revision - Updated pending-review pages to always query only
pendingrecords - Updated summary typing in overview and employee-directory to handle the new status safely
Decisions
draftis a real persisted status, not a client-only flagneeds_revisionis reused as the returned-for-revision state- Draft records are excluded from the HRD pending-review queue
- Draft hours are not counted into review-progress summaries that previously reflected submitted/reviewed work
Verification
npm run gennpm run lintnpm run build
All three completed successfully after the implementation updates.