From c07d4a608c20658cac3f6e09cf3a353734486337 Mon Sep 17 00:00:00 2001
From: thomaswoehlke <thomas.woehlke@gmail.com>
Date: Tue, 11 May 2021 13:01:21 +0200
Subject: [PATCH] working on 0.0.31 Release: UML Modell for Requirements

---
 docs/blueprints/who/uml/who_domain_model.puml |   7 +
 .../who/uml/who_domain_model_import.puml      |  16 +-
 .../who/uml/who_domain_model_star_schema.puml | 137 +------
 docs/blueprints/who/uml/who_services.puml     | 385 ++++++++++++++++++
 4 files changed, 403 insertions(+), 142 deletions(-)
 create mode 100644 docs/blueprints/who/uml/who_services.puml

diff --git a/docs/blueprints/who/uml/who_domain_model.puml b/docs/blueprints/who/uml/who_domain_model.puml
index 342d992a..5f473d6a 100644
--- a/docs/blueprints/who/uml/who_domain_model.puml
+++ b/docs/blueprints/who/uml/who_domain_model.puml
@@ -2,6 +2,7 @@
 left to right direction
 
 package covid19.blueprints.all.model {
+
 	interface AllDateReported {
 	    id: Integer
 		date_reported:  String
@@ -51,6 +52,7 @@ package covid19.blueprints.all.model {
 	    {classifier} find_by_id(other_id: Integer)
 	}
 }
+
 package covid19.blueprints.all.model_import {
 
 	interface AllImportFull {
@@ -108,6 +110,7 @@ package covid19.blueprints.all.model_import {
 	}
 }
 package covid19.blueprints.all.service {
+
 	class AllServiceDownload << (S,red) Service >> {
 		-log_error()
 		-log_success()
@@ -139,6 +142,7 @@ package covid19.blueprints.all.service {
 }
 
 package covid19.blueprints.who.model {
+
 	entity WhoDateReported {
 	    id: Integer
 		date_reported: String
@@ -196,6 +200,7 @@ package covid19.blueprints.who.model {
 	}
 }
 package covid19.blueprints.who.model_import {
+
 	entity WhoImport {
 	    id: Integer
 	    date_reported: String
@@ -225,6 +230,7 @@ package covid19.blueprints.who.model_import {
 		{classifier} update_fact_table()
 		{classifier} update_star_schema()
 	}
+
 	entity WhoFlat {
 	    id: Integer
 	    datum_reported: Date
@@ -257,6 +263,7 @@ package covid19.blueprints.who.model_import {
 		{classifier} get_data_for_day(datum_reported: Date): WhoFlat[]
 	}
 }
+
 package covid19.blueprints.who.service {
 	class WhoService << (S,red) Service >> {
 		database_drop_create_pretask()
diff --git a/docs/blueprints/who/uml/who_domain_model_import.puml b/docs/blueprints/who/uml/who_domain_model_import.puml
index 205191f2..342a1daa 100644
--- a/docs/blueprints/who/uml/who_domain_model_import.puml
+++ b/docs/blueprints/who/uml/who_domain_model_import.puml
@@ -1,6 +1,6 @@
 @startuml
 left to right direction
-package covid19.blueprints.all {
+package covid19.blueprints.all.model_import {
 
 	interface AllImportFull {
 		{classifier} download_file()
@@ -18,7 +18,7 @@ package covid19.blueprints.all {
 		{classifier} update_star_schema()
 	}
 
-	interface DataImport {
+	interface AllImport {
 	    datum_reported: Date
 		location: String
 		location_group: String
@@ -57,7 +57,7 @@ package covid19.blueprints.all {
 	}
 }
 
-package covid19.blueprints.who {
+package covid19.blueprints.who.model_import {
 
 	entity WhoImport {
 	    id: Integer
@@ -112,10 +112,12 @@ package covid19.blueprints.who {
 	}
 
 }
-AllImportFull <|-- DataImport
-AllImportIncrement <|-- DataImport
-DataImport <|-- AllFlat
-DataImport <|-- WhoImport
+AllImportFull <|-- AllImport
+AllImportIncrement <|-- AllImport
+AllImport <|-- AllFlat
+
+AllImport <|-- WhoImport
 AllFlat <|-- WhoFlat
+
 WhoImport <|-- WhoFlat
 @enduml
diff --git a/docs/blueprints/who/uml/who_domain_model_star_schema.puml b/docs/blueprints/who/uml/who_domain_model_star_schema.puml
index e7356dfc..2768c3ac 100644
--- a/docs/blueprints/who/uml/who_domain_model_star_schema.puml
+++ b/docs/blueprints/who/uml/who_domain_model_star_schema.puml
@@ -110,38 +110,6 @@ package covid19.blueprints.all.model {
 	}
 }
 
-package covid19.blueprints.all.service {
-
-	class AllServiceDownload << (S,red) Service >> {
-		-log_error()
-		-log_success()
-		-prepare_download()
-		-download_with_wget()
-		-download_with_subprocess_and_os_native_wget()
-		download_file()
-	}
-	class AllServiceConfig << (T,#FF7700) Transient >> {
-		limit_nr: Integer
-	    data_path: String
-	    slug: String
-	    category: String
-	    sub_category: String
-	    tablename: String
-	    cvsfile_name: String
-	    url_src: String
-	    cvsfile_path: String
-	    msg_job: String
-	    msg_ok: String
-	    msg_error: String
-		create_config_for_who()
-		create_config_for_rki_vaccination()
-		create_config_for_owid()
-		create_config_for_ecdc()
-		create_config_for_rki_bundeslaender()
-		create_config_for_rki_landkreise()
-	}
-}
-
 package covid19.blueprints.who.model {
 
 	entity WhoDateReported {
@@ -261,99 +229,12 @@ package covid19.blueprints.who.model {
 	}
 }
 
-package covid19.blueprints.who.service {
-
-	class WhoService << (S,red) Service >> {
-		database_drop_create_pretask()
-		database_drop_create_posttask()
-		download_files()
-		import_files()
-		update_star_schema()
-		full_update_star_schema()
-	}
-	class WhoServiceImport << (S,red) Service >> {
-	    import_file()
-	}
-	class WhoServiceUpdateBase << (S,red) Service >> {
-	}
-	class WhoServiceUpdateFull << (S,red) Service >> {
-		-full_update_date_reported()
-		-full_update_region()
-		-full_update_country()
-		-full_update_data()
-		full_update_dimension_tables()
-		full_update_fact_table()
-		full_update_star_schema()
-	}
-	class WhoServiceUpdate << (S,red) Service >> {
-	    -update_date_reported()
-	    -update_region()
-	    -update_country()
-	    -update_data()
-	    update_dimension_tables()
-	    update_fact_table()
-	    update_star_schema()
-		-who_import_get_new_dates_as_array()
-	}
-}
-
-package covid19.blueprints.who.views {
-	class who_views_frontend << (B,orchid) Boundary >> {
-	    url_root()
-	    url_home()
-	    url_update_data()
-	    url_rename()
-	    url_kurse_all()
-	    url_kurse_workflow_lektionen(workflow_id: Integer)
-	    url_kurse_workflow_lektion_folien(lektion_id: Integer)
-	    url_abbbildung_id(abbildung_id: Integer)
-	    url_db_dump()
-	    url_db_reimport()
-	    task_data_update()
-	    task_rename_src_files()
-	}
-	class who_celery_tasks << (B,orchid) Boundary >> {
-	    url_root()
-	    url_home()
-	    url_update_data()
-	    url_rename()
-	    url_kurse_all()
-	    url_kurse_workflow_lektionen(workflow_id: Integer)
-	    url_kurse_workflow_lektion_folien(lektion_id: Integer)
-	    url_abbbildung_id(abbildung_id: Integer)
-	    url_db_dump()
-	    url_db_reimport()
-	    task_data_update()
-	    task_rename_src_files()
-	}
-	class who_views_for_tasks << (B,orchid) Boundary >> {
-	    url_root()
-	    url_home()
-	    url_update_data()
-	    url_rename()
-	    url_kurse_all()
-	    url_kurse_workflow_lektionen(workflow_id: Integer)
-	    url_kurse_workflow_lektion_folien(lektion_id: Integer)
-	    url_abbbildung_id(abbildung_id: Integer)
-	    url_db_dump()
-	    url_db_reimport()
-	    task_data_update()
-	    task_rename_src_files()
-	}
-}
-
-
-WhoServiceImport : SQLAlchemy database
-WhoServiceUpdateBase : SQLAlchemy database
-WhoServiceUpdateFull <|-- WhoServiceUpdateBase
-WhoServiceUpdate <|-- WhoServiceUpdateBase
-WhoService : SQLAlchemy database
-AllServiceDownload : SQLAlchemy database
-
 AllImportFull <|-- AllImport
 AllImportIncrement <|-- AllImport
+
 AllImport <|-- WhoImport
 AllFlat <|-- WhoFlat
+
 AllDateReported <|-- WhoDateReported
 AllLocationGroup <|-- WhoCountryRegion
 AllLocation <|-- WhoCountry
@@ -363,18 +244,4 @@ WhoCountry "1" *--> "*" WhoCountryRegion : region
 WhoData "1" *--> "*" WhoCountry : country
 WhoData "1" *--> "*" WhoDateReported : date_reported
 
-WhoService "*" *--> "1"  AllServiceConfig : cfg
-WhoServiceImport "*" --> "1"  AllServiceConfig : cfg
-WhoServiceUpdate "*" --> "1"  AllServiceConfig : cfg
-WhoServiceUpdateFull "*" --> "1"  AllServiceConfig : cfg
-AllServiceDownload "*" --> "1"  AllServiceConfig : cfg
-
-WhoService "1" *--> "1" WhoServiceImport : service_import
-WhoService "1" *--> "1" WhoServiceUpdate : service_update
-WhoService "1" *--> "1" WhoServiceUpdateFull : service_update_full
-WhoService "1" *--> "1" AllServiceDownload : service_download
-
-who_views_frontend "1" --> "1" WhoService : who_service
-who_views_for_tasks "1" --> "1" WhoService : who_service
-who_celery_tasks "1" --> "1" WhoService : who_service
 @enduml
diff --git a/docs/blueprints/who/uml/who_services.puml b/docs/blueprints/who/uml/who_services.puml
new file mode 100644
index 00000000..b8e1904d
--- /dev/null
+++ b/docs/blueprints/who/uml/who_services.puml
@@ -0,0 +1,385 @@
+@startuml
+left to right direction
+
+package covid19.blueprints.all.model {
+
+	interface AllDateReported {
+	    id: Integer
+		date_reported:  String
+	    year_week:  String
+	    datum: Date
+	    year: Integer
+	    month: Integer
+	    day_of_month: Integer
+	    day_of_week: Integer
+	    week_of_year: Integer
+		get_name_for_weekday()
+		{classifier} get_names_for_weekday()
+		{classifier} get_datum_parts(my_date_rep: String)
+		{classifier} get_datum(my_year: Integer, my_month: Integer, my_day: Integer)
+		{classifier} get_datum_as_str(my_year: Integer, my_month: Integer, my_day: Integer)
+		{classifier} my_year_week(my_iso_year: Integer, week_number: Integer)
+		{classifier} create_new_object_factory(my_date_rep: String)
+	}
+	interface AllLocationGroup {
+	    id: Integer
+	    continent:  String
+	    {classifier} remove_all()
+	    {classifier} get_all_as_page(page: Integer)
+	    {classifier} get_all()
+	    {classifier} get_all_as_dict()
+	    {classifier} get_by_id(other_id: Integer)
+	    {classifier} find_by_id(other_id: Integer)
+	}
+	interface AllLocation {
+	    id: Integer
+	    continent:  String
+	    {classifier} remove_all()
+	    {classifier} get_all_as_page(page: Integer)
+	    {classifier} get_all()
+	    {classifier} get_all_as_dict()
+	    {classifier} get_by_id(other_id: Integer)
+	    {classifier} find_by_id(other_id: Integer)
+	}
+	interface AllData {
+	    id: Integer
+	    continent:  String
+	    {classifier} remove_all()
+	    {classifier} get_all_as_page(page: Integer)
+	    {classifier} get_all()
+	    {classifier} get_all_as_dict()
+	    {classifier} get_by_id(other_id: Integer)
+	    {classifier} find_by_id(other_id: Integer)
+	}
+}
+
+package covid19.blueprints.all.model_import {
+
+	interface AllImportFull {
+		{classifier} download_file()
+		{classifier} import_file()
+		{classifier} full_update_dimension_tables()
+		{classifier} full_update_fact_table()
+		{classifier} full_update_star_schema()
+	}
+
+	interface AllImportIncrement {
+		{classifier} download_file()
+		{classifier} import_file()
+		{classifier} update_dimension_tables()
+		{classifier} update_fact_table()
+		{classifier} update_star_schema()
+	}
+
+	interface AllImport {
+	    datum_reported: Date
+		location: String
+		location_group: String
+		{classifier} download_file()
+		{classifier} import_file()
+		{classifier} full_update_dimension_tables()
+		{classifier} full_update_fact_table()
+		{classifier} full_update_star_schema()
+		{classifier} update_dimension_tables()
+		{classifier} update_fact_table()
+		{classifier} update_star_schema()
+	}
+
+	interface AllFlat {
+	    id: Integer
+	    datum_reported: Date
+	    year: Integer
+	    month: Integer
+	    day_of_month: Integer
+		day_of_year: Integer
+	    day_of_week: Integer
+	    week_of_year: Integer
+	    year_week:  String
+	    day_of_week_str: String
+		month_str: String
+		location: String
+		location_group: String
+		{classifier} import_file_flat()
+		{classifier} get_years(): Integer[]
+		{classifier} get_days(): Date[]
+		{classifier} get_days_for_year(year: Integer): Date[]
+		{classifier} get_location_groups(): String[]
+		{classifier} get_locations_for_location_group(location_group: String): String[]
+		{classifier} get_data_for_location(location: String): AllFlat[]
+		{classifier} get_data_for_day(datum_reported: Date): AllFlat[]
+	}
+}
+package covid19.blueprints.all.service {
+
+	class AllServiceDownload << (S,red) Service >> {
+		-log_error()
+		-log_success()
+		-prepare_download()
+		-download_with_wget()
+		-download_with_subprocess_and_os_native_wget()
+		download_file()
+	}
+	class AllServiceConfig << (T,#FF7700) Transient >> {
+		limit_nr: Integer
+	    data_path: String
+	    slug: String
+	    category: String
+	    sub_category: String
+	    tablename: String
+	    cvsfile_name: String
+	    url_src: String
+	    cvsfile_path: String
+	    msg_job: String
+	    msg_ok: String
+	    msg_error: String
+		create_config_for_who()
+		create_config_for_rki_vaccination()
+		create_config_for_owid()
+		create_config_for_ecdc()
+		create_config_for_rki_bundeslaender()
+		create_config_for_rki_landkreise()
+	}
+}
+
+package covid19.blueprints.who.model {
+
+	entity WhoDateReported {
+	    id: Integer
+		date_reported: String
+	    year_week: String
+	    datum: Date
+	    year: Integer
+	    month: Integer
+	    day_of_month: Integer
+	    day_of_week: Integer
+	    week_of_year: Integer
+	    {classifier} create_new_object_factory(my_date_rep)
+	}
+	entity WhoCountryRegion {
+	    id: Integer
+	    location_group: String
+	}
+	entity WhoCountry {
+	    id: Integer
+		country_code: String
+	    location: String
+	    {classifier} remove_all()
+	    {classifier} get_all_as_page(page: Integer)
+	    {classifier} get_all()
+	    {classifier} get_all_as_dict()
+	    {classifier} get_by_id(other_id: Integer)
+	    {classifier} get_germany()
+	    {classifier} find_by_country_code_and_country_and_who_region_id(i_country_code, i_country, my_region)
+	    {classifier} find_by_country_code(i_country_code)
+	    {classifier} find_by_country(i_country)
+	    {classifier} get_by_country_code(i_country_code)
+	    {classifier} get_by_country(i_country)
+	    {classifier} get_who_countries_for_region(region, page)
+	}
+	entity WhoData {
+	    id: Integer
+		cases_new: Integer
+	    cases_cumulative: Integer
+	    deaths_new: Integer
+	    deaths_cumulative: Integer
+	    {classifier} remove_all()
+	    {classifier} get_all_as_page(page: Integer)
+	    {classifier} get_all()
+	    {classifier} get_by_id(other_id: Integer)
+	    {classifier} find_one_or_none_by_date_and_country(my_date_reported, my_country)
+	    {classifier} get_data_for_country(who_country, page)
+	    {classifier} get_data_for_day(date_reported, page)
+	    {classifier} get_data_for_day_order_by_cases_new(date_reported, page)
+	    {classifier} get_data_for_day_order_by_cases_cumulative(date_reported, page)
+	    {classifier} get_data_for_day_order_by_deaths_new(date_reported, page)
+	    {classifier} get_data_for_day_order_by_deaths_cumulative(date_reported, page)
+	    {classifier} get_data_for_country_order_by_cases_new(who_country, page)
+	    {classifier} get_data_for_country_order_by_cases_cumulative(who_country, page)
+	    {classifier} get_data_for_country_order_by_deaths_new(who_country, page)
+	    {classifier} get_data_for_country_order_by_deaths_cumulative(who_country, page)
+	}
+}
+package covid19.blueprints.who.model_import {
+
+	entity WhoImport {
+	    id: Integer
+	    date_reported: String
+	    country_code: String
+	    country: String
+	    who_region: String
+	    new_cases: String
+	    cumulative_cases: String
+	    new_deaths: String
+	    cumulative_deaths: String
+	    # {classifier} remove_all()
+	    # {classifier} get_all_as_page(page: Integer)
+	    # {classifier} get_all()
+	    # {classifier} get_by_id(other_id: Integer)
+	    # {classifier} get_regions()
+	    # {classifier} get_dates_reported()
+	    # {classifier} get_for_one_day(day: String)
+	    # {classifier} get_dates_reported_as_array()
+	    # {classifier} get_new_dates_as_array()
+	    # {classifier} countries()
+		{classifier} download_file()
+		{classifier} import_file()
+		{classifier} full_update_dimension_tables()
+		{classifier} full_update_fact_table()
+		{classifier} full_update_star_schema()
+		{classifier} update_dimension_tables()
+		{classifier} update_fact_table()
+		{classifier} update_star_schema()
+	}
+
+	entity WhoFlat {
+	    id: Integer
+	    datum_reported: Date
+	    year: Integer
+	    month: Integer
+	    day_of_month: Integer
+		day_of_year: Integer
+	    day_of_week: Integer
+	    week_of_year: Integer
+	    year_week:  String
+	    day_of_week_str: String
+		month_str: String
+		location: String
+		location_group: String
+	    date_reported: String
+	    country_code: String
+	    country: String
+	    who_region: String
+	    new_cases: String
+	    cumulative_cases: String
+	    new_deaths: String
+	    cumulative_deaths: String
+		{classifier} import_file_flat()
+		{classifier} get_years(): Integer[]
+		{classifier} get_days(): Date[]
+		{classifier} get_days_for_year(year: Integer): Date[]
+		{classifier} get_location_groups(): String[]
+		{classifier} get_locations_for_location_group(location_group: String): String[]
+		{classifier} get_data_for_location(location: String): WhoFlat[]
+		{classifier} get_data_for_day(datum_reported: Date): WhoFlat[]
+	}
+}
+
+package covid19.blueprints.who.service {
+	class WhoService << (S,red) Service >> {
+		database_drop_create_pretask()
+		database_drop_create_posttask()
+		download_files()
+		import_files()
+		update_star_schema()
+		full_update_star_schema()
+	}
+	class WhoServiceImport << (S,red) Service >> {
+	    import_file()
+	}
+	class WhoServiceUpdateBase << (S,red) Service >> {
+	}
+	class WhoServiceUpdateFull << (S,red) Service >> {
+		-full_update_date_reported()
+		-full_update_region()
+		-full_update_country()
+		-full_update_data()
+		full_update_dimension_tables()
+		full_update_fact_table()
+		full_update_star_schema()
+	}
+	class WhoServiceUpdate << (S,red) Service >> {
+	    -update_date_reported()
+	    -update_region()
+	    -update_country()
+	    -update_data()
+	    update_dimension_tables()
+	    update_fact_table()
+	    update_star_schema()
+		-who_import_get_new_dates_as_array()
+	}
+}
+
+package covid19.blueprints.who.views {
+	class who_views_frontend << (B,orchid) Boundary >> {
+	    url_root()
+	    url_home()
+	    url_update_data()
+	    url_rename()
+	    url_kurse_all()
+	    url_kurse_workflow_lektionen(workflow_id: Integer)
+	    url_kurse_workflow_lektion_folien(lektion_id: Integer)
+	    url_abbbildung_id(abbildung_id: Integer)
+	    url_db_dump()
+	    url_db_reimport()
+	    task_data_update()
+	    task_rename_src_files()
+	}
+	class who_celery_tasks << (B,orchid) Boundary >> {
+	    url_root()
+	    url_home()
+	    url_update_data()
+	    url_rename()
+	    url_kurse_all()
+	    url_kurse_workflow_lektionen(workflow_id: Integer)
+	    url_kurse_workflow_lektion_folien(lektion_id: Integer)
+	    url_abbbildung_id(abbildung_id: Integer)
+	    url_db_dump()
+	    url_db_reimport()
+	    task_data_update()
+	    task_rename_src_files()
+	}
+	class who_views_for_tasks << (B,orchid) Boundary >> {
+	    url_root()
+	    url_home()
+	    url_update_data()
+	    url_rename()
+	    url_kurse_all()
+	    url_kurse_workflow_lektionen(workflow_id: Integer)
+	    url_kurse_workflow_lektion_folien(lektion_id: Integer)
+	    url_abbbildung_id(abbildung_id: Integer)
+	    url_db_dump()
+	    url_db_reimport()
+	    task_data_update()
+	    task_rename_src_files()
+	}
+}
+
+AllImportFull <|-- AllImport
+AllImportIncrement <|-- AllImport
+AllImport <|-- AllFlat
+
+AllImport <|-- WhoImport
+AllFlat <|-- WhoFlat
+WhoImport <|-- WhoFlat
+
+AllDateReported <|-- WhoDateReported
+AllLocationGroup <|-- WhoCountryRegion
+AllLocation <|-- WhoCountry
+AllData <|-- WhoData
+
+WhoData "1" *--> "*" WhoDateReported : date_reported
+WhoCountry "1" *--> "*" WhoCountryRegion : location_group
+WhoData "1" *--> "*" WhoCountry : location
+
+WhoService "*" *--> "1"  AllServiceConfig : cfg
+WhoServiceImport "*" --> "1"  AllServiceConfig : cfg
+WhoServiceUpdate "*" --> "1"  AllServiceConfig : cfg
+WhoServiceUpdateFull "*" --> "1"  AllServiceConfig : cfg
+AllServiceDownload "*" --> "1"  AllServiceConfig : cfg
+
+WhoService "1" *--> "1" WhoServiceImport : service_import
+WhoService "1" *--> "1" WhoServiceUpdate : service_update
+WhoService "1" *--> "1" WhoServiceUpdateFull : service_update_full
+WhoService "1" *--> "1" AllServiceDownload : service_download
+
+WhoServiceUpdateFull <|-- WhoServiceUpdateBase
+WhoServiceUpdate <|-- WhoServiceUpdateBase
+WhoServiceUpdateBase : SQLAlchemy database
+WhoServiceImport : SQLAlchemy database
+AllServiceDownload : SQLAlchemy database
+WhoService : SQLAlchemy database
+
+who_views_frontend "1" --> "1" WhoService : who_service
+who_views_for_tasks "1" --> "1" WhoService : who_service
+who_celery_tasks "1" --> "1" WhoService : who_service
+@enduml
-- 
GitLab