buerokratt / Common-Services

Bürokratt Common Services
MIT License
0 stars 6 forks source link

Convert the weather service from using old ruuter logic with json files to the new one with yml files #32

Open ValterAro opened 1 week ago

ValterAro commented 1 week ago

AS A service manager I WANT the weather service to be functional in the new bürokratt SO THAT it would be available to be used through the bürokratt chat widget

Based on the old weather service convert the logic to yml format and make it work in the new Bürokratt 2.0 .

AC:

ValterAro commented 1 week ago

Additional info: JSON files with the previous logic for ruuter v1. get-data-things.json get-location-things.json get-station-things.json get-things.json

constants: "gazetteer_url":"https://inaadress.maaamet.ee/inaadress", "publicapi_url": "https://publicapi.envir.ee/v1/combinedWeatherData", "ilmmicroservice_url": "https://ilmmicroservice.envir.ee/api/forecasts"

Service was initiated with a yml file:

checkservice:
  switch:
    - condition: ${incoming.body.list[0] === "#weather"}
      next: weatherService
    - condition: ${incoming.body.list[0] == null}
      next: noService
  next: noService

weatherService:
  call: http.post
  args:
    url: https://ruuter.buerokratt.stat.ee/get-things
    body:
     locationName: ${incoming.body.list[1]}
     chatId: ${incoming.body.chatId}
     authorId: ${incoming.body.authorId}
  result: weatherRequest
  next: end