fix(db): coerce Mongo ObjectId _id to str in statements docs #80
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gertjan/bodega!80
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/statements-objectid"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The period-vocabulary fix (#79) made statements queries match the
2026-03-09 refetch docs for the first time — and every one of them
carries a Mongo-generated ObjectId _id, which fails FinancialStatement's
id: str | None validation. All four read paths crashed (ERP refresh,
scores fundamentals, both statements API endpoints).
_doc_to_statement now stringifies _id without mutating the input doc.
Also updates the two repo integration tests broken by #79's
upsert-then-prune semantics: snapshot replacement is keyed on a strictly
increasing computed_at (as in production), so the second save in the
atomic-overwrite tests now carries a later timestamp. Removes a stray
'UTC = UTC' left in the statements repo.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01JRnthdVhGGt5FeSQ8m3aUA