Introduction: ===================== 1. Description in Latvian. 2. Description in English. 3. Task results description. (1) Uzdevuma apraksts: ===================== Izveidot programmu, kas veic OData servisa datu apkopošanu un eksportēšanu. Programmas nosaukums declared-persons-analyser.exe kas ļauj izvadīt atskaites balstoties uz ienākošiem parametriem. Parametru apraksts: ===================== Nosaukums Tips Apraksts ---------------------------------------- source string Servisa adrese. Ja parametrs netiek padots tiek ņemta noklusētā adrese district int Rajona, iecirkņa identifikators. Šis parametrs ir obligāts. year int Gads par kuru apstrādāt datus. month int Mēnesis par kuru apstrādāt datus. day int Mēneša diena par kuru apstrādāt datus. limit int Ierobežojumus, cik ierakstus izvadīt. Ja parametrs netiek norādīts, noklusētā vērtība ir 100. group string Attēlošana pa grupām summējot deklarēto personu skaitu. Iespējamās vērtības: y (grupēt pa gadiem), m (grupēt pa mēnešiem), d (grupēt pa dienām). Piemēri: y, m, d, ym, yd, md. out string Faila nosaukums, kurā izeksportēt izvaddatus JSON formātā. Izvaddati: ===================== o district_name - rajona, iecirkņa nosaukumu. o year - gads, ja group parametrā norādīts y. o month - mēnesis, ja group parametrā norādīts m. o diena - mēneša diena, ja group parametrā norādīts d. o value - vērtības summa grupā. o change - grupas value vērtības izmaiņa pret iepriekšējās grupas value vērtību. o Max - maksimālā value vērtība. o Min - minimālā value vērtība. o Average - vidējā value vērtība, noapaļojot līdz veselam skaitlim. o Max drop - maksimālā krituma vērtība, iecirkņa nosaukums un grupa. o Max increase - maksimālā pieauguma vērtība, iecirkņa nosaukums un grupa. Izvaddatiem jābūt sakārtotiem augošā secībā pēc grupas: gads, mēnesis, diena Piemērs: ===================== declared-persons-analyser.exe -district 516 -year 2019 -limit 4 -group ym –out res.json (2) Task description: ===================== Create a program that collects and exports OData service data. Program name is declared-persons-analyser.exe which allows you to output reports based on incoming parameters. Input data: ===================== Name Type Description ---------------------------------------- source string Service address. If the parameter is not passed, the default address is taken district int Identifier of the district. This parameter is required. year int Year for which to process data. month int Month for which to process data. day int Day of month for which to process data. limit int Limit how many records to output. If no parameter is specified, the default value is 100. group string Display by groups summing the number of persons declared. Possible values: y (group by years), m (group by months), d (group by days). Examples: y, m, d, ym, yd, md. out string The name of the file in which to export the output data in JSON format. Output data: ===================== o district_name - district title. o year - year, if in the group specified parameter y. o month - month, if in the group specified parameter m. o day - day of month, if in the group specified parameter d. o value - the sum of the value in the group. o change - change in the value of the group against the value of the previous group. o Max - maximum 'value' value. o Min - minimum 'value' value. o Average - average 'value' value, rounded to the nearest whole number. o Max drop - maximum drop 'value', name of district and group. o Max increase - maximum increment 'value', name of district and group. The output data must be arranged in ascending order by group: year, month, day. Example: ===================== declared-persons-analyser.exe -district 516 -year 2019 -limit 4 -group ym –out res.json (3) ******************************************* Implementation *********************************************** Console application: - .NET Framework 4.8 - Visual Studio 2019 - Unit tests (MSTest) Additional implementation (out of test requirements): - Web API - NSwag