Skip to content

feat(egress): report loyalty milestones unlocked by a purchase - #35

Open
dinosoeren wants to merge 1 commit into
mainfrom
feat/loyalty-unlocked-milestones
Open

feat(egress): report loyalty milestones unlocked by a purchase#35
dinosoeren wants to merge 1 commit into
mainfrom
feat/loyalty-unlocked-milestones

Conversation

@dinosoeren

@dinosoeren dinosoeren commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Adds unlocked_milestones to the egress PlayerLoyaltyState, so a purchase request reports which loyalty milestones that purchase's points gain crossed. Milestones can be claimed at any time rather than being granted automatically when they are reached, so the moment a milestone becomes available is otherwise not observable from the purchase payload.

  • repeated Milestone unlocked_milestones = 10 on PlayerLoyaltyState, reusing the message's existing nested Milestone shape (milestone_id plus its rewards), so no new vocabulary is introduced.
  • Purely additive: the field is absent whenever the purchase crossed no threshold, so existing payloads are unchanged.
  • A single purchase can cross more than one threshold, so this is repeated rather than a single value.
  • Disjoint from next_milestone by construction: next_milestone is strictly above the reported balance, these are at or below it.

Regenerated the OpenAPI artifacts to match.

part of STORE-1488


Note

Low Risk
Additive API documentation and proto field only; existing payloads stay unchanged when the field is omitted.

Overview
Purchase egress PlayerLoyaltyState now includes unlockedMilestones: milestones whose thresholds were crossed by that purchase’s points gain, each with milestoneId and rewards, reusing the existing Milestone shape. The field is additive (omitted when no threshold was crossed or points did not increase), can list multiple milestones in ascending order, and is documented as disjoint from nextMilestone.

The shared Milestone OpenAPI description is broadened from “next milestone only” to a generic milestone-and-rewards object. docs/gen/swagger.v1.json is regenerated for register/confirm payment and related schemas.

Reviewed by Cursor Bugbot for commit 7a5e2bc. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds unlocked_milestones to the egress PlayerLoyaltyState so a purchase request
reports which loyalty milestones that purchase's points gain crossed.
Milestones can be claimed at any time rather than being granted automatically
when they are reached, so the moment one becomes available is otherwise not
observable from this payload.

The field reuses the message's existing nested Milestone shape, is repeated
because a single purchase can cross more than one threshold, and is disjoint
from next_milestone by construction: next_milestone is strictly above the
reported balance while these are at or below it. It is purely additive, so a
payload that crossed no threshold is unchanged.

Regenerated the OpenAPI artifacts to match.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@dinosoeren
dinosoeren marked this pull request as ready for review August 14, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant