Repository navigation
fix(purchase): preserve unknown provider upfront costs - #450
Conversation
Propagate nullable purchase costs through storage, complete totals, coverage, logs and UI. Reject marketplace pricing without a known basis. Keep known zero distinct and pin the reviewed provider library revision. Closes #446
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: LeanerCloud/cloud-commitments-platform/.coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (46)
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughPurchase upfront costs now distinguish unknown values from zero across database storage, analytics, API responses, and frontend behavior. Unknown costs remain null in totals and coverage calculations, and marketplace listing rejects purchases with unknown upfront costs. ChangesNullable purchase-cost input and storage
Analytics and API behavior
Frontend handling
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~60 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Unknown upfront costs are now kept as null instead of being turned into zero, across storage, totals, and the UI. No blocking issues were found. Follow the documented order: apply the migration first, then deploy the backend and frontend together. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 54.95% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 91 functions across 42 files. (4 skipped: 4 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Preserve unknown provider purchase costs as NULL instead of treating them as zero. Pin all four cloud-commitments-go modules to ce951361290141aa53b528dfce862fbc22a1d01b and carry nullable upfront costs through purchase history, complete API totals, snapshots, coverage, logs and frontend rendering. Known zero remains numeric zero. Marketplace pricing rejects an unknown basis before any listing side effect, including custom schedules.
Migration 000101 removes NOT NULL and zero defaults from purchase_history.upfront_cost and savings_snapshots.total_commitment. Historical zeros remain unchanged. Existing materialized-view total_commitment columns remain known-sample statistics without a completeness guarantee; current APIs do not read those columns. No views are rebuilt.
Apply the migration before deploying nullable writers. Deploy the matching frontend and backend together, and avoid old readers once NULL rows exist. The down migration refuses NULL-bearing data rather than inventing costs. This PR does not apply production migrations.
Validation:
Closes #446
Summary by CodeRabbit