Skip to content

docs(loyalty): fix dangling reference, minor-unit amount, breakdown invariant, and code registries - #662

Open
vishkaty wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
vishkaty:fix/loyalty-polish
Open

docs(loyalty): fix dangling reference, minor-unit amount, breakdown invariant, and code registries#662
vishkaty wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
vishkaty:fix/loyalty-polish

Conversation

@vishkaty

Copy link
Copy Markdown
Contributor

Problem

Four small loyalty corrections:

  1. Dangling example reference. The main example says it builds on a "store loyalty card example" from the checkout Eligibility Verification at Completion section, which contains only a student-verification example.
  2. Minor-unit amount reads as major units. The store-card discount example applies amount: 10 ($0.10 in minor units) while the surrounding text describes a $10 benefit; sibling examples use minor units (1000).
  3. Breakdown has no sum invariant. earning_forecast.breakdown amounts have no statement tying them to earning_forecast.amount, unlike discount allocations and totals.
  4. New codes absent from the examples registries. membership_benefit_eligible and membership_benefit_ineligible are defined in a normative table but not in the info_code/warning_code examples arrays that tooling treats as the standard-code registry.

Fix

  • loyalty.md: reword to build on the eligibility-verification pattern and introduce the store-card scenario inline; correct the four discount/allocation amounts to 1000.
  • loyalty.json: state that the breakdown amounts MUST sum to earning_forecast.amount.
  • info_code.json / warning_code.json: append the two codes.

Verification

The four amount changes sit inside an extract=$.loyalty example, so no totals are affected; the points-earning breakdown (10 + 20 = 30) is untouched. ucp-schema lint source/ and validate_examples.py pass (282, unchanged).

…akdown invariant, and code registries

Four small loyalty corrections:

- The main example says it builds on a "store loyalty card example" from the
  checkout Eligibility Verification at Completion section, which contains only a
  student-verification example. Reword to build on the eligibility-verification
  pattern and introduce the store-card scenario inline.
- The store-card discount example applied `amount: 10` ($0.10 in minor units)
  while the surrounding text describes a $10 benefit; sibling examples use
  minor units (1000). Correct the four discount and allocation amounts to 1000.
- earning_forecast.breakdown had no invariant tying it to the headline amount.
  State that the breakdown amounts MUST sum to `earning_forecast.amount`,
  matching the discount-allocation and totals conventions.
- The standard codes membership_benefit_eligible and
  membership_benefit_ineligible were defined in a normative table but absent
  from the info_code and warning_code examples registries. Append them.
@damaz91 damaz91 added the status:needs-triage Signal that the PR is ready for human triage label Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:needs-triage Signal that the PR is ready for human triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants