feat(api): on-this-day carousel endpoint (spec 056 T001) #1137

Merged
chris merged 1 commit from feat/on-this-day-backend into main 2026-10-12 11:52:55 +02:00
Owner

Summary

New GET /api/timeline/on-this-day endpoint for the Photos start page carousel (spec 056, T001; design: docs/superpowers/specs/2026-10-12-on-this-day-carousel-design.md).

  • TimelineQueryService.onThisDay: server-UTC day matching (same day semantics as timeline day keys), 1..5 years back, years without matches absent, Feb 29 clamps to Feb 28, per year max-5 newest items with true itemCount via windowed COUNT(*) OVER ().
  • One indexed day-interval query per year, reusing the wall's visibility/scope/supported-media predicates verbatim — a card's day is exactly the day section the timeline renders.
  • Injected Clock (UTC) for testability; 2-arg constructor kept for existing callers. Read-only, no migration.

Tests

Service (Testcontainers): year window + empty-year skipping + 6-back exclusion, cap-5 with true count + newest-first, Feb 29 clamping, scope/visibility parity (revoked contribution, trashed, unsupported format), empty response. Controller: media:read scope enforcement + param forwarding. Full :apps:api:test green (pre- and post-rebase onto latest main).

Frontend follows in feat/on-this-day-web (stacked loosely on the same contract).

## Summary New `GET /api/timeline/on-this-day` endpoint for the Photos start page carousel (spec 056, T001; design: `docs/superpowers/specs/2026-10-12-on-this-day-carousel-design.md`). - `TimelineQueryService.onThisDay`: server-UTC day matching (same day semantics as timeline day keys), 1..5 years back, years without matches absent, Feb 29 clamps to Feb 28, per year max-5 newest items with true `itemCount` via windowed `COUNT(*) OVER ()`. - One indexed day-interval query per year, reusing the wall's visibility/scope/supported-media predicates verbatim — a card's day is exactly the day section the timeline renders. - Injected `Clock` (UTC) for testability; 2-arg constructor kept for existing callers. Read-only, no migration. ## Tests Service (Testcontainers): year window + empty-year skipping + 6-back exclusion, cap-5 with true count + newest-first, Feb 29 clamping, scope/visibility parity (revoked contribution, trashed, unsupported format), empty response. Controller: media:read scope enforcement + param forwarding. Full `:apps:api:test` green (pre- and post-rebase onto latest main). Frontend follows in `feat/on-this-day-web` (stacked loosely on the same contract).
feat(api): on-this-day carousel endpoint GET /api/timeline/on-this-day (spec 055 T001)
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 14m18s
93f48354a5
Add TimelineQueryService.onThisDay(userAccountId, scope, sharingGroupId):
one indexed day-interval query per year over 1..5 years back, reusing the
wall's join-backed visibility, lifecycle and supported-media predicates.
Each query returns the day's newest-first item head (capped at 5) plus the
true day total via COUNT(*) OVER (). Years without matches are skipped;
Feb 29 targets clamp to Feb 28 via LocalDate.minusYears; today comes from
the injected Clock in UTC (new three-arg constructor, two-arg kept for
existing callers/tests). No DB migration; read-only.
chris merged commit b9fa60ebad into main 2026-10-12 11:52:55 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
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
chris/memories!1137
No description provided.