Time Tracking
Time tracking allows logging work hours against tasks. Each entry records minutes spent, an optional description, and the date.
Model
TimeEntry
├── taskId (cascade delete)
├── userId
├── minutes (integer)
├── description?
└── date (defaults to now)API Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/tasks/:taskId/time-entries | List time entries for task |
GET | /api/tasks/:taskId/time-total | Total minutes logged on task |
POST | /api/tasks/:taskId/time-entries | Log time entry |
DELETE | /api/time-entries/:id | Delete time entry |
Frontend
TimeTracker Component
The TimeTracker.vue component provides:
- Total time summary for the task
- List of individual entries with author, duration, and description
- Inline form to log new time (minutes + optional description)
- Delete button for own entries
Key Implementation Details
- Time entries are scoped to tasks — each entry references a
taskId - The
time-totalendpoint sums all entries for quick display - Entries record the user who logged the time (
userId) - Date defaults to the current moment but can be overridden