docs: fix the fulfillment discount examples - #755
Open
alexpark20 wants to merge 1 commit into
Open
Conversation
alexpark20
force-pushed
the
docs/discount-free-shipping-totals
branch
from
August 21, 2026 01:00
d0d46a4 to
6c3e8c7
Compare
alexpark20
force-pushed
the
docs/discount-free-shipping-totals
branch
2 times, most recently
from
August 21, 2026 07:32
25a83cc to
5b2adcb
Compare
alexpark20
marked this pull request as ready for review
August 21, 2026 07:51
alexpark20
requested review from
igrigorik and
wry-ry
and removed request for
wry-ry
August 21, 2026 07:51
alexpark20
force-pushed
the
docs/discount-free-shipping-totals
branch
from
August 21, 2026 07:53
5b2adcb to
a0881cd
Compare
damaz91
requested review from
jingyli and
niranjanmanjunath
and removed request for
wry-ry
August 21, 2026 11:51
Two `totals[]` examples represent one free-shipping discount twice: they zero the `fulfillment` entry and also emit an offsetting `discount` entry for the same benefit, so the declared `total` is short by the discount amount. - Mixed discounts (item + order level): line items net to 3200 and shipping is free, so the total is 3200. The example declared 2601. - Price-Impacting Benefits: same shape, declared 651 where the line items net to 850. Both now show the full shipping charge alongside the offsetting discount, and the correct total. The free-shipping discount uses its own title as `display_text` so the pairing is legible. The `allocations` invariant is also scoped to when `allocations` is present: it read as unconditional, yet `allocations` is optional on `applied_discount` and the free-shipping discount in both examples omits it.
alexpark20
force-pushed
the
docs/discount-free-shipping-totals
branch
from
September 10, 2026 01:02
a0881cd to
bb8e595
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two
totals[]examples represent one free-shipping discount twice, so their declaredtotalis short by the discount amount. This corrects both, scopes an invariant that was stated unconditionally, and adds a check so the arithmetic cannot drift again.The misleading examples.
Both examples zero the
fulfillmententry and emit an offsettingdiscountentry for the same free-shipping benefit, subtracting it twice:docs/specification/discount.md→ "Mixed discounts (item + order level)": the line items net to 3200 and shipping is free, so the total is 3200. The example declared 2601.docs/specification/loyalty.md→ "Price-Impacting Benefits": same shape, declared 651 where the line items net to 850.Changes
1. Both examples corrected — the full shipping charge plus the offsetting discount, and the right total. Each discount entry now uses its own title as
display_textso the pairing is legible.2. The
allocationsinvariant scoped to whenallocationsis present. It read as unconditional, yetallocationsis optional onapplied_discountand the free-shipping discount in both examples omits it entirely.3.move to a separate PRscripts/validate_totals.pyCategory (Required)
Please select one or more categories that apply to this change.
ucp-schematool (resolver, linter, validator). (Requires Maintainer approval)Related Issues
Checklist
!for breaking changes).Screenshots / Logs (if applicable)