Skip to content

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

MethodPathDescription
GET/api/tasks/:taskId/time-entriesList time entries for task
GET/api/tasks/:taskId/time-totalTotal minutes logged on task
POST/api/tasks/:taskId/time-entriesLog time entry
DELETE/api/time-entries/:idDelete 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-total endpoint 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