Assumption:
retailUnitCode = market in json file
activity = reason in json file
(1) > "handle events for multiple Customers." = publish to a topic for differente subscribers
(2) > "a given period" = a year
> :customerId is present in the url but not used in the filtering as nothing said so in the pdf
Npm run start
(Send an event to the endpoint)
curl --location 'http://localhost:3000/FI/nzs7qmYPW4BFs2hhTOmdW' \
--header 'Content-Type: application/json' \
--data '{"id":"VbviTfCoGNA2dLp7SiEoe","time":1698923744084,"market":"FI","customerId":"fi.customer-01","reason":"PURCHASE","reasonTime":1697506692598,"businessUnit":"BU02","type":"INCREASED","value":1618}'
+
Connexion to GCP (Application Default Credentials
+
(Demo: Observe a message being send to balance-transactions Topic )

+
(Demo: Pull message to your Subscriber balance-transactions-sub > Messages > -Pull- )

Using postman GET http://localhost:3000/IT/us.customer-01/PURCHASE/2023 { "January": { "openingBalance": 0, "closingBalance": 0 }, {...} "September": { "openingBalance": 0, "closingBalance": 2325 }, "October": { "openingBalance": 2325, "closingBalance": 1913 }, "November": { "openingBalance": 1913, "closingBalance": 1761 }, "December": { "openingBalance": 1761, "closingBalance": 3600 } }