[econ] fix room consumable consume

This commit is contained in:
Devin Zuczek
2026-10-26 18:51:49 -04:00
parent eeb652fef7
commit 4709c390fd
4 changed files with 192 additions and 0 deletions
+21
View File
@@ -1159,6 +1159,27 @@ export const PurchaseRoomConsumableResponse = z.object({
}),
})
/**
* `PUT /api/roomconsumables/v1/roomConsumable/{id}/consume` — just the concurrency pair, at the
* TOP level (not nested under `ConcurrencyCodes` as the purchase sends it). Uses up one.
*/
export const ConsumeRoomConsumableRequest = z.object({
CurrentConcurrencyCode: z.string().nullable().optional().describe('Accepted and NOT checked'),
NewConcurrencyCode: z
.string()
.nullable()
.optional()
.describe('Stored and echoed back as the item’s `ConcurrencyCode`'),
})
/** The consume's answer: the purchase's `OperationResult`, alone. */
export const ConsumeRoomConsumableResponse = z.object({
Status: z.int().describe('0 on success; 1 on a refusal. Always sent — omitted reads as 0'),
InventoryItem: RoomConsumableInventoryItemDto.nullable().describe(
'What the caller holds afterwards (`Count` the resulting total, 0 included); null on a refusal'
),
})
/**
* The envelope the consumable write answers in — the same
* `{ Value, Success, Error, error_id }` the room-currency writes use.