buerokratt / Common-Services

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

Service "Population Metrics (per Year and per Region)" created #4

Open SigritSiht opened 1 year ago

SigritSiht commented 1 year ago

AS a Chatbot trainer I WANT TO write needed DSL files SO THAT end users could consume the Service via Bürokratt

Acceptance Criteria

SA currently also has an intent called "SA_Rahvaarv". Only one will be turned into a Service intent. The other one will either be deleted or SA can repurpose it for overall information about population metrics.

Output

Service Flow(s)

end user can provide information about the location and the year to get more specific data. If the end user does not provide any additional data about year and location, they will not be asked to be provided but current year is queried form a third party API and value "1" will be used for Estonia.

https://andmed.stat.ee/api/v1/et/stat/RV0291U

  "query": [
    {
      "code": "Elukoht",
      "selection": {
        "filter": "item",
        "values": [
          "1"
        ]
      }
    },
    {
      "code": "Aasta",
      "selection": {
        "filter": "item",
        "values": [
          "2022"
        ]
      }
    },
    {
      "code": "Näitaja",
      "selection": {
        "filter": "item",
        "values": [
          "1"
        ]
      }
    }
  ],
  "response": {
    "format": "json-stat2"
  }
}
Values "1" = kogu Eesti
SigritSiht commented 1 year ago

We might need to hard code the current year value for this one.

KlviG commented 1 year ago

location list as of right now:

abja[- ]paluoja antsla elva haapsalu harju hiiu ida[- ]viru jõgeva jõhvi järva kallaste kärdla karksi[- ]nuia kehra keila kilingi[- ]nõmme kiviõli kohtla[- ]järve kunda kuressaare lihula loksa lääne lääne[- ]viru maardu mõisaküla mustvee narva narva[- ]jõesuu otepää paide paldiski pärnu põltsamaa põlva püssi rakvere rapla räpina saaremaa saue sillamäe sindi suure[- ]jaani tallinn tamsalu tapa tartu tõrva türi valga viljandi võhma võru võsu tabasalu ulu jõelähtme jüri sõmeru peetri saku viimsi väike[- ]maarja värska pajusti kõrveküla kelvingi laiaküla leppneeme lubja metsakasti miiduranna muuga pringi pärnamäe püünsi randvere rohuneeme tammneeme äigrumäe prangli naissaar aksi keri kräsuli seinakari kumbli pandju[- ]saare

SigritSiht commented 1 year ago

locations mapping SA.xlsx

KlviG commented 1 year ago

currentYear: call: http.get args: url: https://www.timeapi.io/api/Time/current/zone?timeZone=Europe/Tallinn result: resultcurrentYear

askPeople: call: http.post args: url: https://andmed.stat.ee/api/v1/et/stat/RV0291U body: query:

print: return: ${"Eesti rahvaarv oli " + resultcurrentYear.response.body.year + " aastal "} ${SAanswer.response.body.value} next: end