beardofedu / beardofedu/copilot-cli-fun-times
feat: completedAt timestamp set automatically when task is completed
- Dominant language
- JavaScript
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Automatically set a `completedAt` ISO timestamp on a task when its `completed` field is changed to `true`, and clear it when `completed` is set back to `false`.
## Motivation
Knowing *when* a task was completed is critical for reporting, SLA tracking, and audit history. Without a `completedAt` field, clients must infer completion time from external sources.
## Proposed Behavior
- When `PUT /tasks/:id` is called with `{ completed: true }`, the server sets `completedAt` to the current ISO timestamp
- When `PUT /tasks/:id` is called with `{ completed: false }`, `completedAt` is cleared (set to `null`)
- Clients cannot set `completedAt` directly — it is always managed by the server
- `completedAt` is `null` on newly created tasks
- `GET /tasks/:id` and list responses include the `completedAt` field
## Acceptance Criteria
- [ ] `PUT /tasks/:id` with `completed: true` sets `completedAt` to a valid ISO timestamp
- [ ] `PUT /tasks/:id` with `completed: false` resets `completedAt` to `null`
- [ ] Client-supplied `completedAt` values in the request body are ignored
- [ ] New tasks created via `POST /tasks` have `completedAt: null`
- [ ] Logic for managing `completedAt` is in a utility function
- [ ] Unit tests cover both the set and clear cases
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.