From 9d381d6f851249a91f9a7c5a9bb560bc90716943 Mon Sep 17 00:00:00 2001 From: Stefan Ludwig Date: Fri, 30 Aug 2024 19:02:09 +0200 Subject: [PATCH] add publishing of event to inventory service --- .../json/components/inventory-service.json | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.build/src/json/components/inventory-service.json b/.build/src/json/components/inventory-service.json index b548de7..b6915f2 100644 --- a/.build/src/json/components/inventory-service.json +++ b/.build/src/json/components/inventory-service.json @@ -43,5 +43,37 @@ } ] } - ] + ], + "events" : [ { + "name" : "Product Sold Out", + "type" : "product.sold-out", + "description" : "Emitted whenever a product is completely sold out.", + "example" : "{\n \"id\" : \"13200ae0-34e7-4180-9b06-5455121a5088\",\n \"timestamp\" : \"2024-07-22T12:34:56.789Z\",\n \"product\" : {\n \"productId\" : \"a665ff94-13a5-499f-a530-3c6ff16a84da\"\n }\n}", + "fields" : [ { + "property" : "id", + "type" : "UUID4", + "nullable" : false, + "description" : "The unique ID of the event." + }, { + "property" : "timestamp", + "type" : "ISO-8601 Date+Time (UTC)", + "nullable" : false, + "description" : "The exact instant the event occurred at its source." + }, { + "property" : "product", + "type" : "Object", + "nullable" : false + }, { + "property" : "product.productId", + "type" : "UUID4", + "nullable" : false, + "description" : "The ID of the product." + } ] + } ], + "messaging" : { + "publishedMessages" : [ { + "exchange" : "inventory-events", + "routingKey" : "product.sold-out" + } ] + } }