fix: populate obligation amounts — 16 NULLs filled, category mismatches corrected - #77
Conversation
Corrected category mismatches from seed data (credit_card→credit, property_tax/federal_tax→tax) and added missing 550 W Surf #211 HOA obligation. Already applied to Neon prod. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR introduces a database migration that populates and repairs obligation amounts across multiple categories in the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
To use Codex here, create a Codex account and connect to github. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e49674017
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| UPDATE cc_obligations | ||
| SET amount_due = 2800.00, | ||
| metadata = COALESCE(metadata, '{}'::jsonb) || '{"amount_source": "cook_county_assessor_estimate", "installment": "1st", "tax_year": 2025}'::jsonb | ||
| WHERE category = 'tax' AND payee LIKE '%Addison%'; |
There was a problem hiding this comment.
Use existing obligation categories in amount backfill
These backfill predicates target category = 'tax'/'credit', but the seeded obligations are inserted as property_tax, federal_tax, and credit_card in migrations/0004_seed_data.sql, and there is no earlier migration in this repo that normalizes those categories before 0015 runs. On a fresh environment, the affected UPDATEs match zero rows, so several tax/credit obligations keep NULL amounts and the planner/urgency logic remains blind for those bills.
Useful? React with 👍 / 👎.
| -- 550 W Surf #C211 (ARIBIA LLC - CITY STUDIO): $257.43 assessment + $62.50 cable = $319.93/mo | ||
| -- Outstanding balance: $4,991.93 as of 2026-03-29 | ||
| -- This obligation was missing from seed data entirely — insert it | ||
| INSERT INTO cc_obligations (category, payee, amount_due, amount_minimum, due_date, recurrence, recurrence_day, status, auto_pay, late_fee, grace_period_days, negotiable, metadata) |
There was a problem hiding this comment.
Prevent duplicate #211 HOA obligation insertion
The new #211 HOA obligation is inserted unconditionally, and cc_obligations does not define a uniqueness key on this business identity, so re-running migrations on any database where this row was already applied out-of-band (as noted in the commit message for production) will create duplicate pending obligations and inflate HOA totals. This insert should be guarded with WHERE NOT EXISTS (or an ON CONFLICT path backed by a unique constraint).
Useful? React with 👍 / 👎.
Summary
credit_card→credit,property_tax/federal_tax→tax)cool-bar-13270800) — this PR tracks the SQL in version controlTest plan
SELECTquery post-migration🤖 Generated with Claude Code
Summary by CodeRabbit