feat(api): sort album suggestions by newest photo date #1264

Merged
chris merged 1 commit from feat/album-suggestion-date-order into main 2026-10-16 20:31:22 +02:00
Owner

Summary\n- GET /api/album-suggestions now orders reviewable album suggestions by photo date, newest first: ORDER BY visible_in_default_queue DESC, ends_at DESC, starts_at DESC, id DESC (was default_queue_rank ASC, created_at DESC).\n- visible_in_default_queue DESC stays the leading key so overlap-suppressed suggestions remain de-emphasized at the bottom (spec 003 default-queue visibility rule); only the event-worthiness rank ordering is replaced by date ordering.\n- ends_at/starts_at are the suggestion's capture-time span (NOT NULL), so ordering is deterministic; id DESC is the final tie-breaker.\n- Adds regression test listSuggestionsOrdersNewestPhotoDateFirst plus a candidateWithRange helper that lets a candidate declare explicit start/end instants while keeping fingerprints unique.\n\n## Validation\n- rtk ./gradlew :apps:api:test --tests '*AlbumSuggestionServiceTest*' → BUILD SUCCESSFUL, 38 tests, 0 failures (new test included).\n- No existing test asserted the old rank ordering (existing listSuggestions assertions were order-insensitive).

## Summary\n- `GET /api/album-suggestions` now orders reviewable album suggestions by photo date, newest first: `ORDER BY visible_in_default_queue DESC, ends_at DESC, starts_at DESC, id DESC` (was `default_queue_rank ASC, created_at DESC`).\n- `visible_in_default_queue DESC` stays the leading key so overlap-suppressed suggestions remain de-emphasized at the bottom (spec 003 default-queue visibility rule); only the event-worthiness rank ordering is replaced by date ordering.\n- `ends_at`/`starts_at` are the suggestion's capture-time span (`NOT NULL`), so ordering is deterministic; `id DESC` is the final tie-breaker.\n- Adds regression test `listSuggestionsOrdersNewestPhotoDateFirst` plus a `candidateWithRange` helper that lets a candidate declare explicit start/end instants while keeping fingerprints unique.\n\n## Validation\n- `rtk ./gradlew :apps:api:test --tests '*AlbumSuggestionServiceTest*'` → BUILD SUCCESSFUL, 38 tests, 0 failures (new test included).\n- No existing test asserted the old rank ordering (existing `listSuggestions` assertions were order-insensitive).
feat(api): sort album suggestions by newest photo date
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 5s
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 Android CI 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 / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Deploy postgres (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 10m55s
dce6406f30
chris merged commit 528c7a251d into main 2026-10-16 20:31:22 +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!1264
No description provided.