beardofedu / beardofedu/copilot-cli-fun-times

feat: completedAt timestamp set automatically when task is completed

Open
#8 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.