Repository navigation
FE-3019 fix(billing-web): render the server-reported discount term - #19878
Conversation
|
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: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (26)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughCheckout discount summaries now use server-reported terms. Generated ingest contracts add scheduled-change revert and task-cancellation operations, cancelled task statuses, and a billing capability. The member email schema now accepts any string. ChangesDiscount term summaries
Scheduled-change billing contracts
Task and member ingest contracts
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The discount wording and contract updates appear ready to merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The checkout change uses a validated server field for discount wording. The additional operations are contract declarations, not newly implemented requests. No introduced vulnerability was established, but server-side authorization and recovery behavior remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🎨 Storybook: ✅ Built — View Storybook🌐 Website E2ETip All tests passed.
🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 71678406a6906cb00bc6c349af390d356d21bfdc
Full docs: ADR-DEVEX-LINT-0015 🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measureExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight This candidate changes nothing the matrix measures, so every expensive stage was skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #19878 +/- ##
==========================================
- Coverage 84.81% 84.81% -0.01%
==========================================
Files 3431 3431
Lines 164481 164476 -5
Branches 44912 42977 -1935
==========================================
- Hits 139512 139500 -12
- Misses 23014 23022 +8
+ Partials 1955 1954 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
The summary and the Success card word a discount's term from SubscriptionDiscount.term instead of picking copy from transition_type, the plan duration and the coupon duration. A one-time code on a monthly plan change now reads "This payment only" on Success too.
2ebaf3a to
3dcfbcb
Compare
christian-byrne
left a comment
There was a problem hiding this comment.
Approved at exact head 3dcfbcbab129e38bc61ab49288a8eb8bdd463f8b.
- The UI now renders the server-reported discount term consistently in the summary and success receipt.
- Unknown and ongoing terms remain deliberately unqualified; plural month copy is driven only by the server count.
- The schema, unit, and end-to-end coverage pin the five accepted values and the plan-change mismatch this fixes.
Full context for agent readers
I read the current seven-file diff, PR body, existing reviews, and review threads. There are no unresolved threads, the head is mergeable, and exact-head CI is settled green. The implementation removes the client-side inference from transition type and billing cadence rather than layering the server term on top of it.
Summary
billing-web words a discount's term from the
termthe server reports onSubscriptionDiscount, instead of picking the copy on the client.Builds on #19877 (merged).
Why
transition_type, the plan duration and the coupon duration.Root cause
summaryLedger.tsdiscountTermmappedduration: 'once'to "This payment only" whentransition_typewas notnew_subscriptionand the plan was monthly, otherwise to the plan's first period.transition_type, sosuccessBreakdown.tscould only pass the plan duration, and the same code read "First month" there.How
term(this_payment,first_month,first_year,months,ongoing) toSubscriptionDiscount, in both the preview'sdiscountsand the op statuscharge_breakdownreasons.discountRowlooks the subline up in aTERM_LINEtable keyed byterm.this_payment,first_monthandfirst_yearreuse the existing keys,monthsuses theforMonthsplural withduration_in_months, andongoingor an absent term has no subline. The reads oftransition_type, plan duration anddiscount.duration,DeductionFormat.duration, andBY_DURATION.onceTermare deleted. The Success card sharesdiscountRow, so it reads the same copy.SubscriptionDiscountSchemaextends the generatedzSubscriptionDiscount, which already carriestermas an optional strict enum, so the schema is not redeclared. A newsubscriptionDiscount.test.tspins the inferred type to the five values, parses each, and rejects an unknown term.Testing
termacrossnew_subscription,upgrade,downgradeandduration_changereads the same copy) fail 8 tests against the previoussummaryLedger.ts/successBreakdown.ts.CI=1and--retries=0on :4174: 127 passed. Scenario discounts now carryterm, and the monthly-change test asserts "This payment only" on Success.Where this PR sits in Milestone 3
Screenshots
term: this_payment)Captured from the local billing-web production build (
vite buildandvite previewon :4174) against the e2e mock Cloud, with the same scenario onmainand on this branch. The summary already read "This payment only" onmain; Success read "First month".