beardofedu / beardofedu/copilot-cli-fun-times

feat: dueDate field and getOverdueTasks utility

Open
#11 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
Add an optional `dueDate` field to tasks and implement a `getOverdueTasks(tasks)` utility that returns all incomplete tasks whose due date has passed.

## Motivation
Task management without deadlines is incomplete. A `dueDate` field enables overdue detection, sorting by urgency, and filtering — all of which are foundational to the planned `GET /tasks/stats` endpoint and any future notification system.

## Proposed Behavior
- `POST /tasks` accepts an optional `dueDate` field (ISO 8601 string); stored as-is, defaults to `null`
- `PUT /tasks/:id` allows updating `dueDate`; setting it to `null` clears the deadline
- HTTP 400 if a provided `dueDate` is not a valid ISO 8601 date string
- `getOverdueTasks(tasks)` utility: returns tasks where `dueDate` is non-null, in the past, and `completed === false`
- `GET /tasks?overdue=true` query param filters to only overdue tasks using the utility

## Acceptance Criteria
- [ ] `POST /tasks` stores `dueDate` (ISO string or `null`)
- [ ] `PUT /tasks/:id` can update or clear `dueDate`
- [ ] HTTP 400 returned for non-ISO `dueDate` values
- [ ] `getOverdueTasks(tasks)` exported from `utils.js`
- [ ] `GET /tasks?overdue=true` returns only overdue tasks
- [ ] Unit tests for `getOverdueTasks` cover: no overdue tasks, mixed, all overdue, tasks without dueDate, and completed tasks with past dueDate (should not appear)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the POST /tasks, PUT /tasks/:id, and GET /tasks handlers to see where task fields are validated, stored, and filtered. Add and export getOverdueTasks in utils.js, then run the existing test suite and add unit coverage for the listed overdue-task cases. Done means dueDate creation, updates, clearing, validation, and overdue filtering all match the acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.