2.9 KiB
You are a Senior Full Stack Engineer.
Project: Training Management System (TMS)
Current status: Sprint 5 has been completed and approved.
Before starting Sprint 6, perform a stabilization and technical debt review.
Important constraints:
- Do NOT change folder structure.
- Do NOT migrate ORM.
- Do NOT rename tables.
- Do NOT rename columns.
- Do NOT break existing routes.
- Reuse existing Auth.js.
- Reuse existing Drizzle ORM.
- Reuse existing UI components.
- Maintain Thai UI localization.
Current goal: Prepare the system for Sprint 6 by fixing architecture gaps, validation gaps, and consistency issues discovered during Sprint 4 and Sprint 5.
Part 1: Dashboard Consistency Review
Requirements:
-
Verify dashboard calculations.
-
Ensure dashboard uses only APPROVED training records.
-
Verify:
- Total Hours
- Knowledge Hours
- Skill Hours
- Attitude Hours
-
Ensure policy values are loaded from Training Policy.
-
Remove any remaining hardcoded:
- 30 hours
- 12 hours
- 6 hours
- Create a report listing all hardcoded training targets still found.
Part 2: Authorization Review
Requirements:
-
Review all routes under /dashboard.
-
Verify HRD-only pages:
- /dashboard/pending-review
- /dashboard/training-policy
- /dashboard/import-employees
- /dashboard/master-review
-
Verify Employee cannot access HRD routes.
-
Verify direct URL access is blocked.
-
Verify API routes have server-side authorization.
-
Create authorization review summary.
Part 3: Localization Consistency Review
Requirements:
-
Scan all TMS pages.
-
Find remaining English UI text.
-
Verify:
- Sidebar
- Form Labels
- Buttons
- Table Headers
- Toast Messages
- Validation Messages
- Empty States
- Loading States
- Error States
-
Replace remaining English user-facing text with Thai.
-
Keep internal enums and database values in English.
Part 4: Employee Import Hardening
Requirements:
-
Verify duplicate employee handling.
-
Verify duplicate email handling.
-
Verify invalid status handling.
-
Verify invalid Excel template handling.
-
Add clear Thai error messages.
-
Add downloadable error summary support if easy to implement.
Part 5: Master Review Hardening
Requirements:
-
Verify approve workflow.
-
Verify reject workflow.
-
Verify duplicate department creation prevention.
-
Verify duplicate position creation prevention.
-
Verify organization scoping.
Part 6: Output Review File
Create:
docs/pre-sprint-6-stabilization-review.md
The file must include:
- Summary
- Files Changed
- Issues Found
- Issues Fixed
- Authorization Review
- Localization Review
- Dashboard Review
- Import Review
- Master Review
- Remaining Technical Debt
- Recommended Sprint 6 Scope
Part 7: Deliverables
Return:
- Complete code changes with file paths.
- Content of docs/pre-sprint-6-stabilization-review.md.
- List of unresolved issues requiring Sprint 6.