Skip to content

feat(pickers): thin lookup rows per resource, ordered by last use - #270

Merged
aleskiontherun merged 1 commit into
mainfrom
claude/api-1-picker-lookups
Oct 4, 2026
Merged

aleskiontherun merged 1 commit into
mainfrom
claude/api-1-picker-lookups

Conversation

@aleskiontherun

Copy link
Copy Markdown
Member

Adds GET /trips/lookup, /dive-sites/lookup, /contacts/lookup, /people/lookup, /courses/lookup and /gear-items/lookup beside the list routes. Each returns thin <Model>LookupItem rows: uuid and name, plus the locality for a site, the address for a contact, the username for a person, and brand, type, rented and archived for gear. Search matches what the list matches, and archived gear is never listed. Rows are ordered by the latest live dive naming the item at or before until, then by never-used items newest first, then by name and id. until accepts any shape a form holds (a time with an offset, a time without one, or a bare date) and is normalised to one UTC instant, a date counting to the end of its day. That ordering is a new API contract for the web pickers, and the list routes are unchanged. Cache: each lookup is cached under its resource's existing list prefix as new keys, with :lookup:until_{until} after the colon, so the existing sweeps drop them. The people lookup is uncached, as the people list is. Contacts and courses now rank by dives, so dive create, patch, delete and merge also drop the contact and course caches. No schema change and no deploy-skew shim: the routes are additive.

Verified with the full suite (Postgres-backed tests running), coverage, ruff, mdformat, alembic check and all three mypy runs.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the feat Set from the PR title by pr-title.yml label Oct 4, 2026
@aleskiontherun
aleskiontherun merged commit 5463243 into main Oct 4, 2026
11 checks passed
@aleskiontherun
aleskiontherun deleted the claude/api-1-picker-lookups branch October 4, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat Set from the PR title by pr-title.yml

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant