1.6 KiB
1.6 KiB
You are a Senior Full Stack Engineer.
Project: Training Management System (TMS)
Current status:
- Sprint 5 approved
- Responsive Audit approved
- Mobile UX Review approved
Current task: Implement Sprint 6 Phase 1: Audit Log Foundation
Important constraints:
- Do NOT change folder structure.
- Do NOT migrate ORM.
- Do NOT rename tables.
- Do NOT rename columns.
- Reuse existing Auth.js.
- Reuse existing Drizzle ORM.
- Reuse existing UI components.
- Keep Thai UI.
- Minimal-impact changes only.
Requirements:
- Create Audit Log module.
Route:
- /dashboard/audit-logs
- Create reusable audit service.
Example:
logAuditEvent({ userId, module, action, entityId, oldValue, newValue, ipAddress })
- Track:
Authentication
- LOGIN_SUCCESS
- LOGIN_FAILED
Training Records
- CREATE
- UPDATE
- DELETE
HRD Review
- APPROVE
- REJECT
Course Master
- CREATE
- UPDATE
Training Policy
- CREATE
- UPDATE
Employee Import
- IMPORT
Master Review
- APPROVE
- REJECT
- Audit Log UI
Columns:
- วันที่
- ผู้ใช้งาน
- โมดูล
- รายการ
- รายละเอียด
- Filters
- วันที่
- ผู้ใช้งาน
- โมดูล
- รายการ
-
Search
-
Export CSV
-
Thai UI
-
Role
HRD only
- Output Review File
Create:
docs/sprint-6-phase-1-audit-log-review.md
Include:
- Summary
- Files Changed
- Database Changes
- Events Implemented
- Permission Rules
- Manual Test Checklist
- Known Limitations
- Next Phase Recommendation
Return:
- Complete code changes
- Review file
- Migration commands if required