API: GET /api/history endpoint #3

Open
opened 2026-03-28 02:09:40 +00:00 by forgejo_admin · 0 comments

Type

Feature

Lineage

Standalone — scoped from Daily 100 design spec.

Repo

forgejo_admin/daily-100-api

User Story

As a user
I want to view my entry history
So that the heat map can display my consistency over time

Context

GET /api/history returns entries for a date range. Default is last 90 days. Optional query params start_date and end_date for custom ranges. Each entry includes date and all 8 boolean fields. Used by the frontend heat map component.

File Targets

Files the agent should modify or create:

  • app/routes/history.py -- GET endpoint handler

Files the agent should NOT touch:

  • app/models.py -- already defined
  • app/routes/today.py -- separate concern

Acceptance Criteria

  • Default returns last 90 days of entries
  • Optional start_date/end_date query params work
  • Returns array of entries ordered by date DESC
  • Each entry includes date + 8 boolean fields

Test Expectations

  • Unit test: default 90-day range
  • Unit test: custom date range
  • Unit test: empty results for no-data range
  • Run command: pytest tests/test_history.py

Constraints

  • ISO 8601 date format (YYYY-MM-DD)
  • Query params: ?start_date=2026-01-01&end_date=2026-03-27

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • daily-100 -- project
### Type Feature ### Lineage Standalone — scoped from Daily 100 design spec. ### Repo `forgejo_admin/daily-100-api` ### User Story As a user I want to view my entry history So that the heat map can display my consistency over time ### Context GET /api/history returns entries for a date range. Default is last 90 days. Optional query params `start_date` and `end_date` for custom ranges. Each entry includes date and all 8 boolean fields. Used by the frontend heat map component. ### File Targets Files the agent should modify or create: - `app/routes/history.py` -- GET endpoint handler Files the agent should NOT touch: - `app/models.py` -- already defined - `app/routes/today.py` -- separate concern ### Acceptance Criteria - [ ] Default returns last 90 days of entries - [ ] Optional start_date/end_date query params work - [ ] Returns array of entries ordered by date DESC - [ ] Each entry includes date + 8 boolean fields ### Test Expectations - [ ] Unit test: default 90-day range - [ ] Unit test: custom date range - [ ] Unit test: empty results for no-data range - Run command: `pytest tests/test_history.py` ### Constraints - ISO 8601 date format (YYYY-MM-DD) - Query params: `?start_date=2026-01-01&end_date=2026-03-27` ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `daily-100` -- project
Commenting is not possible because the repository is archived.
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/daily-100-api#3
No description provided.