Skip to content

feat(catalog): add bonus_items and metadata to FreeItem - #33

Merged
dinosoeren merged 1 commit into
mainfrom
feat/free-item-bonus-items-and-metadata
Jul 23, 2026
Merged

feat(catalog): add bonus_items and metadata to FreeItem#33
dinosoeren merged 1 commit into
mainfrom
feat/free-item-bonus-items-and-metadata

Conversation

@dinosoeren

@dinosoeren dinosoeren commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Adds two optional fields to the egress catalog FreeItem message so a free (claimable) catalog item can declare bonus rewards and forward webhook metadata:

  • bonus_items — a repeated list of typed bonus rewards (type + id + amount) granted when the item is claimed. The only reward kind granted today is LOYALTY_POINTS; other/unspecified types are ignored by consumers.
  • metadata — a map<string, string> of opaque key-value pairs forwarded to webhook events for the item, mirroring the existing product metadata field (not for display or business logic).

Both fields are additive and optional, so existing responses are unaffected. Regenerated the merged OpenAPI spec (docs/gen/swagger.v1.json).


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Note

Low Risk
Additive protobuf/OpenAPI contract changes only; no runtime logic in this diff, so backward compatibility is preserved for clients that omit the new fields.

Overview
Extends egress catalog FreeItem with two optional fields and regenerates swagger.v1.json.

bonus_items is a repeated FreeBonusItem (type, id, amount) describing extra rewards on claim (e.g. loyalty points). A new FreeBonusItemType enum is added; only LOYALTY_POINTS is granted today—other values are documented as ignored by consumers. amount is validated as a non-empty digit string for large integers.

metadata is a map<string, string> for opaque key-value data forwarded on related webhook events, aligned with purchasable product metadata (not for UI or business logic).

Both fields are additive; existing FreeItem payloads stay valid without them.

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

@dinosoeren
dinosoeren force-pushed the feat/free-item-bonus-items-and-metadata branch from 9c77de3 to 192daca Compare July 23, 2026 01:20
Adds two optional fields to the egress catalog FreeItem message:
- repeated bonus_items, each a typed bonus reward (type + id + amount) granted
  when the item is claimed; the only reward kind granted today is LOYALTY_POINTS.
- a metadata map of opaque key-value pairs forwarded to webhook events, mirroring
  the product metadata field (not for display or business logic).

Regenerated the merged OpenAPI spec.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dinosoeren
dinosoeren force-pushed the feat/free-item-bonus-items-and-metadata branch from 192daca to 3667f79 Compare July 23, 2026 01:21
@dinosoeren
dinosoeren merged commit d34be3b into main Jul 23, 2026
2 checks passed
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