From 75b277f0655f0138f08dfa42dc20fd3e8fe49c80 Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Mon, 10 May 2021 21:13:21 +0200 Subject: [PATCH] working on: 0.0.34 Release --- .../all/uml/all_domain_model_star_schema.puml | 140 ++++++++------- .../uml/ecdc_domain_model_star_schmema.puml | 45 ++--- .../owid/uml/owid_domain_model.puml | 45 +++-- .../uml/owid_domain_model_star_schema.puml | 60 +++---- .../rki_cases_domain_model_star_schema.puml | 124 +++++++------ docs/blueprints/who/uml/who_domain_model.puml | 166 ++++++++++++++---- .../who/uml/who_domain_model_star_schema.puml | 119 +++++++++++-- 7 files changed, 452 insertions(+), 247 deletions(-) diff --git a/docs/blueprints/all/uml/all_domain_model_star_schema.puml b/docs/blueprints/all/uml/all_domain_model_star_schema.puml index d31a3c83..c42a1940 100644 --- a/docs/blueprints/all/uml/all_domain_model_star_schema.puml +++ b/docs/blueprints/all/uml/all_domain_model_star_schema.puml @@ -1,7 +1,10 @@ @startuml left to right direction -package covid19.blueprints.all { - entity AllDateReported { + + +package covid19.blueprints.all.model { + + interface AllDateReported { id: Integer date_reported: String year_week: String @@ -19,19 +22,27 @@ package covid19.blueprints.all { {classifier} my_year_week(my_iso_year: Integer, week_number: Integer) {classifier} create_new_object_factory(my_date_rep: String) } - entity AllLocationGroup { + interface AllDateReported { id: Integer - location_group: 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) + 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) } - entity AllLocation { + interface AllLocationGroup { id: Integer - location: String + continent: String {classifier} remove_all() {classifier} get_all_as_page(page: Integer) {classifier} get_all() @@ -39,67 +50,69 @@ package covid19.blueprints.all { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } - entity AllData { + interface AllLocation { id: Integer - {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 + } + + 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() } - entity RkiDateReported { + + 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 - date_reported: String - year_week: String - datum: Date + datum_reported: Date year: Integer month: Integer day_of_month: Integer + day_of_year: 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) - } - class ApplicationPage << (T,#FF7700) Transient >> { - title: String - subtitle: String - subtitle_info: String - } - class ApplicationServiceConfig << (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() - } - class ApplicationServiceDownload << (S,red) Service >> { - -log_error() - -log_success() - -prepare_download() - -download_with_wget() - -download_with_subprocess_and_os_native_wget() - download_file() + 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 . { class database << (S,#FF7700) Singleton >> { {static} int port @@ -125,6 +138,7 @@ package . { url_root() } } + package covid19.blueprints.all { class application_services << (P,yellow) Proxy >> { diff --git a/docs/blueprints/ecdc/uml/ecdc_domain_model_star_schmema.puml b/docs/blueprints/ecdc/uml/ecdc_domain_model_star_schmema.puml index 8e31aec5..a3c2973c 100644 --- a/docs/blueprints/ecdc/uml/ecdc_domain_model_star_schmema.puml +++ b/docs/blueprints/ecdc/uml/ecdc_domain_model_star_schmema.puml @@ -1,9 +1,9 @@ @startuml left to right direction -package covid19.blueprints.all { +package covid19.blueprints.all.model { - entity ApplicationDateReported { + interface AllDateReported { id: Integer date_reported: String year_week: String @@ -21,7 +21,7 @@ package covid19.blueprints.all { {classifier} my_year_week(my_iso_year: Integer, week_number: Integer) {classifier} create_new_object_factory(my_date_rep: String) } - entity ApplicationDateReported { + interface AllDateReported { id: Integer date_reported: String year_week: String @@ -39,7 +39,7 @@ package covid19.blueprints.all { {classifier} my_year_week(my_iso_year: Integer, week_number: Integer) {classifier} create_new_object_factory(my_date_rep: String) } - entity ApplicationRegion { + interface AllLocationGroup { id: Integer continent: String {classifier} remove_all() @@ -49,33 +49,11 @@ package covid19.blueprints.all { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } - class ApplicationServiceDownload << (S,red) Service >> { - -log_error() - -log_success() - -prepare_download() - -download_with_wget() - -download_with_subprocess_and_os_native_wget() - download_file() - } - class ApplicationServiceConfig << (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() + interface AllLocation { + id: Integer + } + interface AllData { + id: Integer } interface AllImportFull { @@ -85,6 +63,7 @@ package covid19.blueprints.all { {classifier} full_update_fact_table() {classifier} full_update_star_schema() } + interface AllImportIncrement { {classifier} download_file() {classifier} import_file() @@ -92,7 +71,8 @@ package covid19.blueprints.all { {classifier} update_fact_table() {classifier} update_star_schema() } - interface DataImport { + + interface AllImport { datum_reported: Date location: String location_group: String @@ -105,6 +85,7 @@ package covid19.blueprints.all { {classifier} update_fact_table() {classifier} update_star_schema() } + interface AllFlat { id: Integer datum_reported: Date diff --git a/docs/blueprints/owid/uml/owid_domain_model.puml b/docs/blueprints/owid/uml/owid_domain_model.puml index 3f5cdccc..38c76269 100644 --- a/docs/blueprints/owid/uml/owid_domain_model.puml +++ b/docs/blueprints/owid/uml/owid_domain_model.puml @@ -1,9 +1,9 @@ @startuml left to right direction -package covid19.blueprints.all { +package covid19.blueprints.all.model { - entity ApplicationDateReported { + entity AllDateReported { id: Integer date_reported: String year_week: String @@ -21,7 +21,7 @@ package covid19.blueprints.all { {classifier} my_year_week(my_iso_year: Integer, week_number: Integer) {classifier} create_new_object_factory(my_date_rep: String) } - entity ApplicationRegion { + entity AllLocationGroup { id: Integer continent: String {classifier} remove_all() @@ -31,7 +31,7 @@ package covid19.blueprints.all { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } - class ApplicationServiceDownload << (S,red) Service >> { + class AllServiceDownload << (S,red) Service >> { -log_error() -log_success() -prepare_download() @@ -39,7 +39,7 @@ package covid19.blueprints.all { -download_with_subprocess_and_os_native_wget() download_file() } - class ApplicationServiceConfig << (T,#FF7700) Transient >> { + class AllServiceConfig << (T,#FF7700) Transient >> { limit_nr: Integer data_path: String slug: String @@ -76,7 +76,7 @@ package covid19.blueprints.all { {classifier} update_star_schema() } - interface DataImport { + interface AllImport { datum_reported: Date location: String location_group: String @@ -115,7 +115,8 @@ package covid19.blueprints.all { } } -package covid19.blueprints.owid { +package covid19.blueprints.owid.model { + entity OwidImport { id: Integer iso_code: String @@ -375,6 +376,9 @@ package covid19.blueprints.owid { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } +} + +package covid19.blueprints.owid.service { class OwidServiceImport << (S,red) Service >> { import_file() } @@ -417,6 +421,9 @@ package covid19.blueprints.owid { update_fact_table_initial_only() update_fact_table_incremental_only() } +} + +package covid19.blueprints.owid.views { class owid_views_frontend << (B,orchid) Boundary >> { url_owid_info() url_owid_tasks() @@ -454,29 +461,29 @@ OwidServiceUpdateBase : SQLAlchemy database OwidServiceUpdateFull : SQLAlchemy database OwidServiceUpdate : SQLAlchemy database OwidService : SQLAlchemy database -ApplicationServiceDownload : SQLAlchemy database +AllServiceDownload : SQLAlchemy database OwidServiceUpdateFull <|-- OwidServiceUpdateBase OwidServiceUpdate <|-- OwidServiceUpdateBase -ApplicationDateReported <|-- OwidDateReported -ApplicationRegion <|-- OwidContinent +AllDateReported <|-- OwidDateReported +AllLocationGroup <|-- OwidContinent OwidCountry "1" *--> "*" OwidContinent : region OwidData "1" *--> "*" OwidCountry : country OwidData "1" *--> "*" OwidDateReported : date_reported -OwidService "*" *--> "1" ApplicationServiceConfig : cfg -OwidServiceImport "*" --> "1" ApplicationServiceConfig : cfg -OwidServiceUpdate "*" --> "1" ApplicationServiceConfig : cfg -ApplicationServiceDownload "*" --> "1" ApplicationServiceConfig : cfg +OwidService "*" *--> "1" AllServiceConfig : cfg +OwidServiceImport "*" --> "1" AllServiceConfig : cfg +OwidServiceUpdate "*" --> "1" AllServiceConfig : cfg +AllServiceDownload "*" --> "1" AllServiceConfig : cfg OwidService "1" *--> "1" OwidServiceImport : owid_service_import OwidService "1" *--> "1" OwidServiceUpdate : owid_service_update OwidService "1" *--> "1" OwidServiceUpdateFull : owid_service_update -OwidService "1" *--> "1" ApplicationServiceDownload : service_download +OwidService "1" *--> "1" AllServiceDownload : service_download owid_views_frontend "1" --> "1" OwidService : owid_service owid_views_for_tasks "1" --> "1" OwidService : owid_service owid_celery_tasks "1" --> "1" OwidService : owid_service -AllImportFull <|-- DataImport -AllImportIncrement <|-- DataImport -DataImport <|-- AllFlat -DataImport <|-- OwidImport +AllImportFull <|-- AllImport +AllImportIncrement <|-- AllImport +AllImport <|-- AllFlat +AllImport <|-- OwidImport AllFlat <|-- OwidFlat OwidImport <|-- OwidFlat @enduml diff --git a/docs/blueprints/owid/uml/owid_domain_model_star_schema.puml b/docs/blueprints/owid/uml/owid_domain_model_star_schema.puml index 3f5cdccc..db171a49 100644 --- a/docs/blueprints/owid/uml/owid_domain_model_star_schema.puml +++ b/docs/blueprints/owid/uml/owid_domain_model_star_schema.puml @@ -1,9 +1,28 @@ @startuml left to right direction -package covid19.blueprints.all { - entity ApplicationDateReported { +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 AllDateReported { id: Integer date_reported: String year_week: String @@ -21,7 +40,7 @@ package covid19.blueprints.all { {classifier} my_year_week(my_iso_year: Integer, week_number: Integer) {classifier} create_new_object_factory(my_date_rep: String) } - entity ApplicationRegion { + interface AllLocationGroup { id: Integer continent: String {classifier} remove_all() @@ -31,33 +50,11 @@ package covid19.blueprints.all { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } - class ApplicationServiceDownload << (S,red) Service >> { - -log_error() - -log_success() - -prepare_download() - -download_with_wget() - -download_with_subprocess_and_os_native_wget() - download_file() - } - class ApplicationServiceConfig << (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() + interface AllLocation { + id: Integer + } + interface AllData { + id: Integer } interface AllImportFull { @@ -76,7 +73,7 @@ package covid19.blueprints.all { {classifier} update_star_schema() } - interface DataImport { + interface AllImport { datum_reported: Date location: String location_group: String @@ -115,6 +112,7 @@ package covid19.blueprints.all { } } + package covid19.blueprints.owid { entity OwidImport { id: Integer diff --git a/docs/blueprints/rki_cases/uml/rki_cases_domain_model_star_schema.puml b/docs/blueprints/rki_cases/uml/rki_cases_domain_model_star_schema.puml index db5743be..9a2a3137 100644 --- a/docs/blueprints/rki_cases/uml/rki_cases_domain_model_star_schema.puml +++ b/docs/blueprints/rki_cases/uml/rki_cases_domain_model_star_schema.puml @@ -1,9 +1,9 @@ @startuml left to right direction -package covid19.blueprints.all { +package covid19.blueprints.all.model { - interface ApplicationDateReported { + interface AllDateReported { id: Integer date_reported: String year_week: String @@ -21,7 +21,25 @@ package covid19.blueprints.all { {classifier} my_year_week(my_iso_year: Integer, week_number: Integer) {classifier} create_new_object_factory(my_date_rep: String) } - interface ApplicationRegion { + 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() @@ -31,33 +49,11 @@ package covid19.blueprints.all { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } - class ApplicationServiceDownload << (S,red) Service >> { - -log_error() - -log_success() - -prepare_download() - -download_with_wget() - -download_with_subprocess_and_os_native_wget() - download_file() - } - class ApplicationServiceConfig << (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() + interface AllLocation { + id: Integer + } + interface AllData { + id: Integer } interface AllImportFull { @@ -76,7 +72,7 @@ package covid19.blueprints.all { {classifier} update_star_schema() } - interface DataImport { + interface AllImport { datum_reported: Date location: String location_group: String @@ -114,7 +110,9 @@ package covid19.blueprints.all { {classifier} get_data_for_day(datum_reported: Date): AllFlat[] } } -package covid19.blueprints.rki_cases { + + +package covid19.blueprints.rki_cases.model { entity RkiImport { id: Integer @@ -255,6 +253,15 @@ package covid19.blueprints.rki_cases { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } +} + +package covid19.blueprints.all.service { + class AllServiceConfig {} + class AllServiceDownload {} +} + +package covid19.blueprints.rki_cases.service { + class RkiServiceImport << (S,red) Service >> { import_file() } @@ -297,6 +304,10 @@ package covid19.blueprints.rki_cases { update_fact_table_initial_only() update_fact_table_incremental_only() } +} + +package covid19.blueprints.rki_cases.views { + class rki_cases_views_frontend << (B,orchid) Boundary >> { url_get_import() url_get_flat() @@ -322,33 +333,44 @@ package covid19.blueprints.rki_cases { task_update_star_schema() } } + +AllImportFull <|-- AllImport +AllImportIncrement <|-- AllImport +AllImport <|-- AllFlat +AllFlat <|-- RkiFlat + +AllImport <|-- RkiImport +RkiImport <|-- RkiFlat +AllDateReported <|-- RkiMeldedatum +AllLocationGroup <|-- RkiBundesland +AllLocation <|-- RkiLandkreis +AllData <|-- RkiData + +RkiLandkreis "1" *--> "*" RkiBundesland : bundesland +RkiData "1" *--> "*" RkiLandkreis : landkreis +RkiData "1" *--> "*" RkiMeldedatum : meldedatum + +RkiServiceUpdateBase <|-- RkiServiceUpdateFull +RkiServiceUpdateBase <|-- RkiServiceUpdate + +AllServiceDownload : SQLAlchemy database RkiServiceImport : SQLAlchemy database RkiServiceUpdateBase : SQLAlchemy database RkiServiceUpdateFull : SQLAlchemy database RkiServiceUpdate : SQLAlchemy database RkiService : SQLAlchemy database -ApplicationServiceDownload : SQLAlchemy database -RkiServiceUpdateBase <|-- RkiServiceUpdateFull -RkiServiceUpdateBase <|-- RkiServiceUpdate -ApplicationDateReported <|-- RkiMeldedatum -ApplicationRegion <|-- RkiBundesland -RkiLandkreis "1" *--> "*" RkiBundesland : bundesland -RkiData "1" *--> "*" RkiLandkreis : landkreis -RkiData "1" *--> "*" RkiMeldedatum : meldedatum -RkiService "*" *--> "1" ApplicationServiceConfig : cfg -RkiServiceImport "*" --> "1" ApplicationServiceConfig : cfg -RkiServiceUpdate "*" --> "1" ApplicationServiceConfig : cfg -ApplicationServiceDownload "*" --> "1" ApplicationServiceConfig : cfg + +RkiService "*" *--> "1" AllServiceConfig : cfg +RkiServiceImport "*" --> "1" AllServiceConfig : cfg +RkiServiceUpdate "*" --> "1" AllServiceConfig : cfg +AllServiceDownload "*" --> "1" AllServiceConfig : cfg + RkiService "1" *--> "1" RkiServiceImport : rki_service_import RkiService "1" *--> "1" RkiServiceUpdate : rki_service_update RkiService "1" *--> "1" RkiServiceUpdateFull : rki_service_update -RkiService "1" *--> "1" ApplicationServiceDownload : service_download +RkiService "1" *--> "1" AllServiceDownload : service_download + rki_cases_views_frontend "1" --> "1" RkiService : rki_service rki_cases_celery_tasks "1" --> "1" RkiService : rki_service -AllImportFull <|-- DataImport -AllImportIncrement <|-- DataImport -DataImport <|-- AllFlat -DataImport <|-- RkiImport -AllFlat <|-- RkiFlat -RkiImport <|-- RkiFlat + @enduml diff --git a/docs/blueprints/who/uml/who_domain_model.puml b/docs/blueprints/who/uml/who_domain_model.puml index 5cd027b2..342d992a 100644 --- a/docs/blueprints/who/uml/who_domain_model.puml +++ b/docs/blueprints/who/uml/who_domain_model.puml @@ -1,7 +1,8 @@ @startuml left to right direction -package covid19.blueprints.all { - entity ApplicationDateReported { + +package covid19.blueprints.all.model { + interface AllDateReported { id: Integer date_reported: String year_week: String @@ -19,25 +20,27 @@ package covid19.blueprints.all { {classifier} my_year_week(my_iso_year: Integer, week_number: Integer) {classifier} create_new_object_factory(my_date_rep: String) } - entity ApplicationDateReported { + interface AllLocationGroup { 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) + 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) } - entity ApplicationRegion { + interface AllData { id: Integer continent: String {classifier} remove_all() @@ -47,7 +50,65 @@ package covid19.blueprints.all { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } - class ApplicationServiceDownload << (S,red) Service >> { +} +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() @@ -55,7 +116,7 @@ package covid19.blueprints.all { -download_with_subprocess_and_os_native_wget() download_file() } - class ApplicationServiceConfig << (T,#FF7700) Transient >> { + class AllServiceConfig << (T,#FF7700) Transient >> { limit_nr: Integer data_path: String slug: String @@ -76,7 +137,8 @@ package covid19.blueprints.all { create_config_for_rki_landkreise() } } -package covid19.blueprints.who { + +package covid19.blueprints.who.model { entity WhoDateReported { id: Integer date_reported: String @@ -91,12 +153,12 @@ package covid19.blueprints.who { } entity WhoCountryRegion { id: Integer - region: String + location_group: String } entity WhoCountry { id: Integer country_code: String - country: String + location: String {classifier} remove_all() {classifier} get_all_as_page(page: Integer) {classifier} get_all() @@ -132,6 +194,8 @@ package covid19.blueprints.who { {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 @@ -192,6 +256,8 @@ package covid19.blueprints.who { {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() @@ -224,6 +290,8 @@ package covid19.blueprints.who { 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() @@ -272,22 +340,50 @@ WhoServiceUpdateBase : SQLAlchemy database WhoServiceUpdateFull <|-- WhoServiceUpdateBase WhoServiceUpdate <|-- WhoServiceUpdateBase WhoService : SQLAlchemy database -ApplicationServiceDownload : SQLAlchemy database -ApplicationDateReported <|-- WhoDateReported -ApplicationRegion <|-- WhoCountryRegion -WhoCountry "1" *--> "*" WhoCountryRegion : region -WhoData "1" *--> "*" WhoCountry : country +AllServiceDownload : SQLAlchemy database + +AllDateReported <|-- WhoDateReported +AllLocationGroup <|-- WhoCountryRegion +AllLocation <|-- WhoCountry +AllData <|-- WhoData + WhoData "1" *--> "*" WhoDateReported : date_reported -WhoService "*" *--> "1" ApplicationServiceConfig : cfg -WhoServiceImport "*" --> "1" ApplicationServiceConfig : cfg -WhoServiceUpdate "*" --> "1" ApplicationServiceConfig : cfg -WhoServiceUpdateFull "*" --> "1" ApplicationServiceConfig : cfg -ApplicationServiceDownload "*" --> "1" ApplicationServiceConfig : cfg +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" ApplicationServiceDownload : service_download +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 + +AllImportFull <|-- AllImport +AllImportIncrement <|-- AllImport +AllImport <|-- AllFlat + +AllImport <|-- WhoImport +AllImport <|-- EcdcImport +AllImport <|-- RkiVaccinationImport +AllImport <|-- RkiImport +AllImport <|-- OwidImport + +AllFlat <|-- WhoFlat +AllFlat <|-- EcdcFlat +AllFlat <|-- RkiVaccinationFlat +AllFlat <|-- RkiFlat +AllFlat <|-- OwidFlat + +WhoImport <|-- WhoFlat +EcdcImport <|-- EcdcFlat +RkiVaccinationImport <|-- RkiVaccinationFlat +RkiImport <|-- RkiFlat +OwidImport <|-- OwidFlat @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 5cd027b2..e7356dfc 100644 --- a/docs/blueprints/who/uml/who_domain_model_star_schema.puml +++ b/docs/blueprints/who/uml/who_domain_model_star_schema.puml @@ -1,7 +1,8 @@ @startuml left to right direction -package covid19.blueprints.all { - entity ApplicationDateReported { +package covid19.blueprints.all.model { + + interface AllDateReported { id: Integer date_reported: String year_week: String @@ -19,7 +20,7 @@ package covid19.blueprints.all { {classifier} my_year_week(my_iso_year: Integer, week_number: Integer) {classifier} create_new_object_factory(my_date_rep: String) } - entity ApplicationDateReported { + interface AllDateReported { id: Integer date_reported: String year_week: String @@ -37,7 +38,7 @@ package covid19.blueprints.all { {classifier} my_year_week(my_iso_year: Integer, week_number: Integer) {classifier} create_new_object_factory(my_date_rep: String) } - entity ApplicationRegion { + interface AllLocationGroup { id: Integer continent: String {classifier} remove_all() @@ -47,7 +48,71 @@ package covid19.blueprints.all { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } - class ApplicationServiceDownload << (S,red) Service >> { + interface AllLocation { + id: Integer + } + interface AllData { + id: Integer + } + + 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() @@ -55,7 +120,7 @@ package covid19.blueprints.all { -download_with_subprocess_and_os_native_wget() download_file() } - class ApplicationServiceConfig << (T,#FF7700) Transient >> { + class AllServiceConfig << (T,#FF7700) Transient >> { limit_nr: Integer data_path: String slug: String @@ -76,7 +141,9 @@ package covid19.blueprints.all { create_config_for_rki_landkreise() } } -package covid19.blueprints.who { + +package covid19.blueprints.who.model { + entity WhoDateReported { id: Integer date_reported: String @@ -192,6 +259,10 @@ package covid19.blueprints.who { {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() @@ -224,6 +295,9 @@ package covid19.blueprints.who { 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() @@ -267,26 +341,39 @@ package covid19.blueprints.who { task_rename_src_files() } } + + WhoServiceImport : SQLAlchemy database WhoServiceUpdateBase : SQLAlchemy database WhoServiceUpdateFull <|-- WhoServiceUpdateBase WhoServiceUpdate <|-- WhoServiceUpdateBase WhoService : SQLAlchemy database -ApplicationServiceDownload : SQLAlchemy database -ApplicationDateReported <|-- WhoDateReported -ApplicationRegion <|-- WhoCountryRegion +AllServiceDownload : SQLAlchemy database + +AllImportFull <|-- AllImport +AllImportIncrement <|-- AllImport +AllImport <|-- WhoImport +AllFlat <|-- WhoFlat +AllDateReported <|-- WhoDateReported +AllLocationGroup <|-- WhoCountryRegion +AllLocation <|-- WhoCountry +AllData <|-- WhoData + WhoCountry "1" *--> "*" WhoCountryRegion : region WhoData "1" *--> "*" WhoCountry : country WhoData "1" *--> "*" WhoDateReported : date_reported -WhoService "*" *--> "1" ApplicationServiceConfig : cfg -WhoServiceImport "*" --> "1" ApplicationServiceConfig : cfg -WhoServiceUpdate "*" --> "1" ApplicationServiceConfig : cfg -WhoServiceUpdateFull "*" --> "1" ApplicationServiceConfig : cfg -ApplicationServiceDownload "*" --> "1" ApplicationServiceConfig : cfg + +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" ApplicationServiceDownload : service_download +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 -- GitLab