From 6b8724bc7cca03b37528bd73d47cc09bc363fbb8 Mon Sep 17 00:00:00 2001 From: dinosoeren Date: Wed, 17 Jun 2026 23:43:33 -0600 Subject: [PATCH] feat(catalog): add loyalty tier fields to egress catalog API --- docs/gen/swagger.v1.json | 58 +++++++++++++++++++++ server/egress/shop/catalog/v1/service.proto | 18 +++++++ 2 files changed, 76 insertions(+) diff --git a/docs/gen/swagger.v1.json b/docs/gen/swagger.v1.json index a7ed182..fceeef2 100644 --- a/docs/gen/swagger.v1.json +++ b/docs/gen/swagger.v1.json @@ -1315,6 +1315,10 @@ }, "description": "Optional display attributes for the card", "title": "Free Item Attributes" + }, + "targetTierId": { + "type": "string", + "description": "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier." } }, "description": "Free-to-claim catalog item", @@ -2602,6 +2606,10 @@ }, "description": "Optional display attributes for the card", "title": "Free Item Attributes" + }, + "targetTierId": { + "type": "string", + "description": "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier." } }, "description": "Free-to-claim catalog item", @@ -2802,6 +2810,20 @@ "PAYMENT_ENVIRONMENT_PRODUCTION" ], "default": "PAYMENT_ENVIRONMENT_UNSPECIFIED" + }, + { + "name": "currentTierId", + "description": "Optional identifier of the player's current loyalty tier, resolved by Stash when a loyalty program is enabled. Use it to select the reward bundle for the player's current tier.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "nextTierId", + "description": "Optional identifier of the loyalty tier directly above the player's current tier (absent at the top tier), resolved by Stash when a loyalty program is enabled. Use it to return a locked preview of the next tier's reward.", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -4539,6 +4561,10 @@ }, "description": "Optional display attributes for the card", "title": "Free Item Attributes" + }, + "targetTierId": { + "type": "string", + "description": "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier." } }, "description": "Represents a claimable free catalog item", @@ -7233,6 +7259,10 @@ }, "description": "Optional display attributes for the card", "title": "Free Item Attributes" + }, + "targetTierId": { + "type": "string", + "description": "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier." } }, "description": "Free-to-claim catalog item", @@ -8520,6 +8550,10 @@ }, "description": "Optional display attributes for the card", "title": "Free Item Attributes" + }, + "targetTierId": { + "type": "string", + "description": "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier." } }, "description": "Free-to-claim catalog item", @@ -10731,6 +10765,10 @@ }, "description": "Optional display attributes for the card", "title": "Free Item Attributes" + }, + "targetTierId": { + "type": "string", + "description": "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier." } }, "description": "Free-to-claim catalog item", @@ -12018,6 +12056,10 @@ }, "description": "Optional display attributes for the card", "title": "Free Item Attributes" + }, + "targetTierId": { + "type": "string", + "description": "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier." } }, "description": "Free-to-claim catalog item", @@ -13363,6 +13405,10 @@ }, "description": "Optional display attributes for the card", "title": "Free Item Attributes" + }, + "targetTierId": { + "type": "string", + "description": "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier." } }, "description": "Free-to-claim catalog item", @@ -15643,6 +15689,10 @@ }, "description": "Optional display attributes for the card", "title": "Free Item Attributes" + }, + "targetTierId": { + "type": "string", + "description": "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier." } }, "description": "Free-to-claim catalog item", @@ -17336,6 +17386,10 @@ }, "description": "Optional display attributes for the card", "title": "Free Item Attributes" + }, + "targetTierId": { + "type": "string", + "description": "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier." } }, "description": "Free-to-claim catalog item", @@ -18623,6 +18677,10 @@ }, "description": "Optional display attributes for the card", "title": "Free Item Attributes" + }, + "targetTierId": { + "type": "string", + "description": "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier." } }, "description": "Free-to-claim catalog item", diff --git a/server/egress/shop/catalog/v1/service.proto b/server/egress/shop/catalog/v1/service.proto index 9e3ce02..94ffa43 100644 --- a/server/egress/shop/catalog/v1/service.proto +++ b/server/egress/shop/catalog/v1/service.proto @@ -104,6 +104,23 @@ message GetCatalogRequest { // so the game backend can attribute the request to a specific shop. string shop_id = 6 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The originating Stash shop identifier (mirrors the shopId sent in webhooks)"}]; server.egress.shop.v1.PaymentEnvironment environment = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Payment environment for the request"}]; + // Resolved by Stash when a loyalty program is enabled; lets the game backend + // return the catalog (e.g. a tier-based daily gift) for the player's tier + // without resolving the tier itself. + optional string current_tier_id = 7 [ + (validate.rules).string = { + min_len: 1 + ignore_empty: true + }, + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Optional identifier of the player's current loyalty tier, resolved by Stash when a loyalty program is enabled. Use it to select the reward bundle for the player's current tier."} + ]; + optional string next_tier_id = 8 [ + (validate.rules).string = { + min_len: 1 + ignore_empty: true + }, + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Optional identifier of the loyalty tier directly above the player's current tier (absent at the top tier), resolved by Stash when a loyalty program is enabled. Use it to return a locked preview of the next tier's reward."} + ]; } message GetCatalogResponse { @@ -709,6 +726,7 @@ message GetCatalogResponse { (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "In-game items included in this free item as a bundle"} ]; optional FreeItemAttributes attributes = 8 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Optional display attributes for the card"}]; + optional string target_tier_id = 9 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "Optional identifier of the loyalty tier this free item targets. For a locked preview of the next tier's reward, return the item with status LOCKED and the next tier's identifier."}]; } oneof item {