fix: ensure count is never null in GET /refractor/cards (#182) #184

Open
Claude wants to merge 2 commits from issue/182-bug-get-refractor-cards-returns-count-null-with-ou into main

2 Commits

Author SHA1 Message Date
Cal Corum
dbc24d0365 fix: ensure count is never null in GET /refractor/cards (#182)
Peewee's .count() on a complex multi-join query can return None when the
result wrapper yields an empty cursor for a 0-row result set.  Guard with
`or 0` so the response contract (count is always an integer) is upheld.

Note: tier values outside 0–4 already return 422 via FastAPI's ge/le
constraints on the tier parameter, so the reproduced scenario
(tier=99 → count: null) is also covered by validation.

Closes #182

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 06:28:30 +00:00
Cal Corum
75b26ecabb docs: fix dev PostgreSQL container/db/user in CLAUDE.md
Dev environment uses sba_postgres container, paperdynasty_dev database,
sba_admin user — not pd_postgres/pd_master as previously documented.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 06:28:30 +00:00