From b67170518fb41e4e51c6b1e5632413ffe720f504 Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Tue, 11 May 2021 14:47:04 +0200 Subject: [PATCH] working on 0.0.31 Release: UML Modell for Requirements --- .../all/uml/all_domain_model_star_schema.puml | 438 +++--------------- .../ecdc/uml/ecdc_domain_model.puml | 231 +++------ .../ecdc/uml/ecdc_domain_model_import.puml | 7 +- .../uml/ecdc_domain_model_star_schmema.puml | 230 +-------- .../owid/uml/owid_domain_model_import.puml | 6 +- .../uml/owid_domain_model_star_schema.puml | 274 ++--------- .../rki_cases/uml/rki_cases_domain_model.puml | 105 ++--- .../uml/rki_cases_domain_model_import.puml | 15 +- .../rki_cases_domain_model_star_schema.puml | 257 +--------- .../uml/rki_vaccination_domain_model.puml | 317 ++++++------- .../rki_vaccination_domain_model_import.puml | 263 ++++++----- ..._vaccination_domain_model_star_schema.puml | 192 +------- docs/blueprints/who/uml/who_domain_model.puml | 371 +++++---------- .../who/uml/who_domain_model_import.puml | 1 + .../who/uml/who_domain_model_star_schema.puml | 144 +----- 15 files changed, 657 insertions(+), 2194 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 c42a1940..e4177253 100644 --- a/docs/blueprints/all/uml/all_domain_model_star_schema.puml +++ b/docs/blueprints/all/uml/all_domain_model_star_schema.puml @@ -22,24 +22,7 @@ package covid19.blueprints.all.model { {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 - 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 @@ -56,391 +39,84 @@ package covid19.blueprints.all.model { 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.ecdc.model { + entity EcdcContinent {} + entity EcdcCountry {} + entity EcdcData {} + entity EcdcDateReported {} } +AllDateReported <|-- EcdcDateReported +AllLocationGroup <|-- EcdcContinent +AllLocation <|-- EcdcCountry -package . { - class database << (S,#FF7700) Singleton >> { - {static} int port - {static} bool run_run_with_debug - {static} int ITEMS_PER_PAGE - app: Flask - db: SQLAlchemy - admin: Admin - app_cors: CORS - app_bootstrap: Bootstrap - create_app() - create_db(my_app) - create_db_test(my_app) - create_celery(my_app) - create_admin(my_app) - } - class application_workers << (B,orchid) Boundary >> { - run_mq(my_app, my_celery) - run_app(my_app) - } - class application_views << (B,orchid) Boundary >> { - url_home() - url_root() - } -} +EcdcCountry "1" *--> "*" EcdcContinent: continent +EcdcData "1" *--> "*" EcdcCountry: country +EcdcData "1" *--> "*" EcdcDateReported: date_reported -package covid19.blueprints.all { - class application_services << (P,yellow) Proxy >> { - } +package covid19.blueprints.owid.model { + entity OwidContinent {} + entity OwidCountry {} + entity OwidData {} + entity OwidDateReported {} } -package covid19.blueprints.app_application { - class ApplicationService << (S,red) Service >> { - } - class AdminService << (S,red) Service >> { +AllDateReported <|-- OwidDateReported +AllLocationGroup <|-- OwidContinent +AllLocation <|-- OwidCountry +AllData <|-- OwidData - } -} -package covid19.blueprints.who { - 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 - region: String - } - entity WhoCountry { - id: Integer - country_code: String - country: 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) - } +OwidCountry "1" *--> "*" OwidContinent : region +OwidData "1" *--> "*" OwidCountry : country +OwidData "1" *--> "*" OwidDateReported : date_reported - class WhoService << (S,red) Service >> { - } +package covid19.blueprints.rki_cases.model { + entity RkiBundesland {} + entity RkiLandkreis {} + entity RkiData {} + entity RkiMeldedatum {} } -package covid19.blueprints.ecdc { - entity EcdcDateReported { - 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 EcdcContinent { - id: Integer - dateiname: String - parent_dir: String - get_absolute_path() - get_relative_path() - {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) - {classifier} get_workflow_for_id(workflow_id: Integer) - } - entity EcdcCountry { - id: Integer - dateiname: String - parent_dir: String - title: String - lektion_nr: Integer - verified: Boolean - get_absolute_path() - get_relative_path() - {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) - {classifier} get_lektionen_for_workflow(workflow: Workflow) - {classifier} get_lektion_for_id(lektion_id: Integer) - {classifier} get_folien_for_lektion_id(lektion_id: Integer) - {classifier} get_all_verified() - } - entity EcdcData { - id: Integer - dateiname: String - parent_dir: String - title: String - lektion_nr: Integer - foliensatz_nr_in_lektion: Integer - get_absolute_path() - get_relative_path() - {classifier} get_foliensaetze_for_lektion(lektion: Lektion) - {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) - } +AllDateReported <|-- RkiMeldedatum +AllLocationGroup <|-- RkiBundesland +AllLocation <|-- RkiLandkreis +AllData <|-- RkiData - class EcdcService << (S,red) Service >> { +RkiLandkreis "1" *--> "*" RkiBundesland : bundesland +RkiData "1" *--> "*" RkiLandkreis : landkreis +RkiData "1" *--> "*" RkiMeldedatum : meldedatum - } -} -package covid19.blueprints.rki_vaccination { - class RkiVaccinationService << (S,red) Service >> { - } +package covid19.blueprints.rki_vaccination.model { + entity RkiVaccinationDateReported {} + entity RkiVaccinationData {} } -package covid19.blueprints.rki_cases { - class RkiBundeslaenderService << (S,red) Service >> { - } - class RkiLandkreiseService << (S,red) Service >> { +AllDateReported <|-- RkiVaccinationDateReported +AllData <|-- RkiVaccinationData - } +RkiVaccinationData "1" *--> "*" RkiVaccinationDateReported : date_reported + + +package covid19.blueprints.who.model { + entity WhoRegion {} + entity WhoCountry {} + entity WhoData {} + entity WhoDateReported {} } -package covid19.blueprints.owid { - entity OwidDateReported { - 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} 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 OwidContinent { - 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 OwidCountry { - id: Integer - iso_code: String - location: String - stringency_index: String - population: String - population_density: String - median_age: String - aged_65_older: String - aged_70_older: String - gdp_per_capita: String - extreme_poverty: String - cardiovasc_death_rate: String - diabetes_prevalence: String - female_smokers: String - male_smokers: String - handwashing_facilities: String - hospital_beds_per_thousand: String - life_expectancy: String - human_development_index: 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 OwidData { - id: Integer - total_cases: String - new_cases: String - new_cases_smoothed: String - total_deaths: String - new_deaths: String - new_deaths_smoothed: String - total_cases_per_million: String - new_cases_per_million: String - new_cases_smoothed_per_million: String - total_deaths_per_million: String - new_deaths_per_million: String - new_deaths_smoothed_per_million: String - reproduction_rate: String - icu_patients: String - icu_patients_per_million: String - hosp_patients: String - hosp_patients_per_million: String - weekly_icu_admissions: String - weekly_icu_admissions_per_million: String - weekly_hosp_admissions: String - weekly_hosp_admissions_per_million: String - new_tests: String - total_tests: String - total_tests_per_thousand: String - new_tests_per_thousand: String - new_tests_smoothed: String - new_tests_smoothed_per_thousand: String - positive_rate: String - tests_per_case: String - tests_units: String - total_vaccinations: String - people_vaccinated: String - people_fully_vaccinated: String - new_vaccinations: String - new_vaccinations_smoothed: String - total_vaccinations_per_hundred: String - people_vaccinated_per_hundred: String - people_fully_vaccinated_per_hundred: String - new_vaccinations_smoothed_per_million: String - stringency_index: 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) - } +AllDateReported <|-- WhoDateReported +AllLocationGroup <|-- WhoRegion +AllLocation <|-- WhoCountry +AllData <|-- WhoData - class OwidService << (S,red) Service >> { +WhoCountry "1" *--> "*" WhoRegion : region +WhoData "1" *--> "*" WhoCountry : country +WhoData "1" *--> "*" WhoDateReported : date_reported - } -} -ApplicationDateReported <|-- RkiDateReported -ApplicationServiceDownload "*" --> "1" ApplicationServiceConfig: cfg -application_workers "1" --> "1" application_services: application_services -application_views "1" --> "1" application_services: application_services -application_views "*" --> "1" ApplicationPage: page_info -application_services "*" --> "1" ApplicationService: application_service -application_services "*" --> "1" AdminService: admin_service -application_services "*" --> "1" WhoService: who_service -application_services "*" --> "1" EcdcService: ecdc_service -application_services "*" --> "1" RkiVaccinationService: rki_vaccination_service -application_services "*" --> "1" RkiBundeslaenderService: rki_service_bundeslaender -application_services "*" --> "1" RkiLandkreiseService: rki_service_landkreise -application_services "*" --> "1" OwidService: owid_service -ApplicationService "*" --> "1" database -ApplicationServiceDownload "*" --> "1" database -AdminService "*" --> "1" database -WhoService "*" --> "1" database -EcdcService "*" --> "1" database -RkiBundeslaenderService "*" --> "1" database -RkiLandkreiseService "*" --> "1" database -RkiVaccinationService "*" --> "1" database -OwidService "*" --> "1" database -ApplicationService : SQLAlchemy database -ApplicationServiceDownload : SQLAlchemy database -AdminService : SQLAlchemy database -WhoService : SQLAlchemy database -EcdcService : SQLAlchemy database -RkiBundeslaenderService : SQLAlchemy database -RkiLandkreiseService : SQLAlchemy database -RkiVaccinationService : SQLAlchemy database -OwidService : SQLAlchemy database @enduml diff --git a/docs/blueprints/ecdc/uml/ecdc_domain_model.puml b/docs/blueprints/ecdc/uml/ecdc_domain_model.puml index 8e31aec5..779ca9e7 100644 --- a/docs/blueprints/ecdc/uml/ecdc_domain_model.puml +++ b/docs/blueprints/ecdc/uml/ecdc_domain_model.puml @@ -1,82 +1,8 @@ @startuml left to right direction -package covid19.blueprints.all { - entity ApplicationDateReported { - 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 ApplicationDateReported { - 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 ApplicationRegion { - 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) - } - 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() - } +package covid19.blueprints.all.model_import { interface AllImportFull { {classifier} download_file() @@ -85,6 +11,7 @@ package covid19.blueprints.all { {classifier} full_update_fact_table() {classifier} full_update_star_schema() } + interface AllImportIncrement { {classifier} download_file() {classifier} import_file() @@ -92,6 +19,7 @@ package covid19.blueprints.all { {classifier} update_fact_table() {classifier} update_star_schema() } + interface DataImport { datum_reported: Date location: String @@ -105,6 +33,7 @@ package covid19.blueprints.all { {classifier} update_fact_table() {classifier} update_star_schema() } + interface AllFlat { id: Integer datum_reported: Date @@ -128,9 +57,10 @@ package covid19.blueprints.all { {classifier} get_data_for_location(location: String): AllFlat[] {classifier} get_data_for_day(datum_reported: Date): AllFlat[] } + } -package covid19.blueprints.ecdc { +package covid19.blueprints.ecdc.model_import { entity EcdcImport { id: Integer @@ -192,6 +122,61 @@ package covid19.blueprints.ecdc { {classifier} get_data_for_day(datum_reported: Date): EcdcFlat[] } +} + +AllImportFull <|-- DataImport +AllImportIncrement <|-- DataImport +DataImport <|-- AllFlat +DataImport <|-- EcdcImport +AllFlat <|-- EcdcFlat +EcdcImport <|-- EcdcFlat + + + +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 + } + + interface AllData { + id: Integer + } + +} + +package covid19.blueprints.ecdc.model { + entity EcdcDateReported { id: Integer dateiname: String @@ -208,6 +193,7 @@ package covid19.blueprints.ecdc { {classifier} find_by_id(other_id: Integer) {classifier} get_kurse_all() } + entity EcdcContinent { id: Integer dateiname: String @@ -222,6 +208,7 @@ package covid19.blueprints.ecdc { {classifier} find_by_id(other_id: Integer) {classifier} get_workflow_for_id(workflow_id: Integer) } + entity EcdcCountry { id: Integer dateiname: String @@ -242,6 +229,7 @@ package covid19.blueprints.ecdc { {classifier} get_folien_for_lektion_id(lektion_id: Integer) {classifier} get_all_verified() } + entity EcdcData { id: Integer dateiname: String @@ -259,93 +247,14 @@ package covid19.blueprints.ecdc { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } - class EcdcService << (S,red) Service >> { - pretask_database_drop_create() - task_database_drop_create() - run_download_only() - run_import_only() - run_update_dimension_tables_only() - run_update_fact_table_incremental_only() - run_update_fact_table_initial_only() - run_update_star_schema_incremental() - run_update_star_schema_initial() - download_all_files() - task_import_all_files() - update_dimension_tables_only() - update_fact_table_initial_only() - update_fact_table_incremental_only() - } - class EcdcServiceImport << (S,red) Service >> { - import_file() - } - class EcdcServiceUpdate << (S,red) Service >> { - -update_date_reported() - -update_continent() - -update_country() - -get_continent_from_import(ecdc_import: EcdcImport): - -get_country_from_import(ecdc_import: EcdcImport): - -get_date_reported_from_import() - -update_data_initial() - update_dimension_tables_only() - update_fact_table_initial_only() - update_star_schema_incremental() - update_star_schema_initial() - } - class ecdc_views_frontend << (B,orchid) Boundary >> { - url_ecdc_info() - url_ecdc_tasks() - url_ecdc_data_imported() - url_ecdc_date_reported_all() - url_ecdc_date_reported_one_notification_rate() - url_ecdc_date_reported_one_deaths_weekly() - url_ecdc_date_reported_one_cases_weekly() - url_ecdc_continent_all() - url_ecdc_continent_one() - url_ecdc_country_all() - url_ecdc_country_one() - url_ecdc_country_germany() - } - class ecdc_views_for_tasks << (B,orchid) Boundary >> { - task_ecdc_download_only() - task_who_import_only() - task_who_update_dimension_tables_only() - task_who_update_fact_table_initial_only() - task_who_update_fact_table_incremental_only() - task_who_update_star_schema_initial() - task_who_update_star_schema_incremental() - } - class ecdc_celery_tasks << (B,orchid) Boundary >> { - task_ecdc_download_only() - task_ecdc_import_only() - task_ecdc_update_dimension_tables_only() - task_ecdc_update_fact_table_initial_only() - task_ecdc_update_fact_table_incremental_only() - task_ecdc_update_star_schema_initial() - task_ecdc_update_star_schema_incremental() - } } -ApplicationServiceDownload : SQLAlchemy database -EcdcServiceImport : SQLAlchemy database -EcdcServiceUpdate : SQLAlchemy database -EcdcService : SQLAlchemy database -ApplicationDateReported <|-- EcdcDateReported -ApplicationRegion <|-- EcdcContinent + +AllDateReported <|-- EcdcDateReported +AllLocationGroup <|-- EcdcContinent +AllLocation <|-- EcdcCountry + EcdcCountry "1" *--> "*" EcdcContinent: continent EcdcData "1" *--> "*" EcdcCountry: country EcdcData "1" *--> "*" EcdcDateReported: date_reported -EcdcService "*" *--> "1" ApplicationServiceConfig: cfg -EcdcServiceImport "*" --> "1" ApplicationServiceConfig: cfg -EcdcServiceUpdate "*" --> "1" ApplicationServiceConfig: cfg -EcdcService "1" *--> "1" EcdcServiceImport: ecdc_service_import -EcdcService "1" *--> "1" EcdcServiceUpdate: ecdc_service_update -EcdcService "1" *--> "1" ApplicationServiceDownload: service_download -ecdc_views_frontend "1" --> "1" EcdcService: ecdc_service -ecdc_views_for_tasks "1" --> "1" EcdcService: ecdc_service -ecdc_celery_tasks "1" --> "1" EcdcService: ecdc_service -AllImportFull <|-- DataImport -AllImportIncrement <|-- DataImport -DataImport <|-- AllFlat -DataImport <|-- EcdcImport -AllFlat <|-- EcdcFlat -EcdcImport <|-- EcdcFlat + @enduml diff --git a/docs/blueprints/ecdc/uml/ecdc_domain_model_import.puml b/docs/blueprints/ecdc/uml/ecdc_domain_model_import.puml index 9277e4b1..1be9b6fd 100644 --- a/docs/blueprints/ecdc/uml/ecdc_domain_model_import.puml +++ b/docs/blueprints/ecdc/uml/ecdc_domain_model_import.puml @@ -1,7 +1,7 @@ @startuml left to right direction -package covid19.blueprints.all { +package covid19.blueprints.all.model_import { interface AllImportFull { {classifier} download_file() @@ -59,7 +59,7 @@ package covid19.blueprints.all { } -package covid19.blueprints.ecdc { +package covid19.blueprints.ecdc.model_import { entity EcdcImport { id: Integer @@ -122,10 +122,13 @@ package covid19.blueprints.ecdc { } } + AllImportFull <|-- DataImport AllImportIncrement <|-- DataImport DataImport <|-- AllFlat DataImport <|-- EcdcImport AllFlat <|-- EcdcFlat EcdcImport <|-- EcdcFlat + + @enduml 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 a3c2973c..31185f4b 100644 --- a/docs/blueprints/ecdc/uml/ecdc_domain_model_star_schmema.puml +++ b/docs/blueprints/ecdc/uml/ecdc_domain_model_star_schmema.puml @@ -21,24 +21,7 @@ package covid19.blueprints.all.model { {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 - 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 @@ -49,129 +32,18 @@ package covid19.blueprints.all.model { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } + 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.ecdc { - - entity EcdcImport { - id: Integer - date_rep: String - date_rep_day: String - date_rep_month: String - date_rep_year: String - cases: String - deaths: String - pop_data_2019: String - countries_and_territories: String - geo_id: String - country_territory_code: String - continent_exp: String - cumulative_number_for_14_days_of_covid19_cases_per_100000: 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() - } - - entity EcdcFlat { - 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_rep: String - date_rep_day: String - date_rep_month: String - date_rep_year: String - cases: String - deaths: String - pop_data_2019: String - countries_and_territories: String - geo_id: String - country_territory_code: String - continent_exp: String - cumulative_number_for_14_days_of_covid19_cases_per_100000: 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): EcdcFlat[] - {classifier} get_data_for_day(datum_reported: Date): EcdcFlat[] - } +package covid19.blueprints.ecdc.model { entity EcdcDateReported { id: Integer @@ -189,6 +61,7 @@ package covid19.blueprints.ecdc { {classifier} find_by_id(other_id: Integer) {classifier} get_kurse_all() } + entity EcdcContinent { id: Integer dateiname: String @@ -203,6 +76,7 @@ package covid19.blueprints.ecdc { {classifier} find_by_id(other_id: Integer) {classifier} get_workflow_for_id(workflow_id: Integer) } + entity EcdcCountry { id: Integer dateiname: String @@ -223,6 +97,7 @@ package covid19.blueprints.ecdc { {classifier} get_folien_for_lektion_id(lektion_id: Integer) {classifier} get_all_verified() } + entity EcdcData { id: Integer dateiname: String @@ -240,93 +115,14 @@ package covid19.blueprints.ecdc { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } - class EcdcService << (S,red) Service >> { - pretask_database_drop_create() - task_database_drop_create() - run_download_only() - run_import_only() - run_update_dimension_tables_only() - run_update_fact_table_incremental_only() - run_update_fact_table_initial_only() - run_update_star_schema_incremental() - run_update_star_schema_initial() - download_all_files() - task_import_all_files() - update_dimension_tables_only() - update_fact_table_initial_only() - update_fact_table_incremental_only() - } - class EcdcServiceImport << (S,red) Service >> { - import_file() - } - class EcdcServiceUpdate << (S,red) Service >> { - -update_date_reported() - -update_continent() - -update_country() - -get_continent_from_import(ecdc_import: EcdcImport): - -get_country_from_import(ecdc_import: EcdcImport): - -get_date_reported_from_import() - -update_data_initial() - update_dimension_tables_only() - update_fact_table_initial_only() - update_star_schema_incremental() - update_star_schema_initial() - } - class ecdc_views_frontend << (B,orchid) Boundary >> { - url_ecdc_info() - url_ecdc_tasks() - url_ecdc_data_imported() - url_ecdc_date_reported_all() - url_ecdc_date_reported_one_notification_rate() - url_ecdc_date_reported_one_deaths_weekly() - url_ecdc_date_reported_one_cases_weekly() - url_ecdc_continent_all() - url_ecdc_continent_one() - url_ecdc_country_all() - url_ecdc_country_one() - url_ecdc_country_germany() - } - class ecdc_views_for_tasks << (B,orchid) Boundary >> { - task_ecdc_download_only() - task_who_import_only() - task_who_update_dimension_tables_only() - task_who_update_fact_table_initial_only() - task_who_update_fact_table_incremental_only() - task_who_update_star_schema_initial() - task_who_update_star_schema_incremental() - } - class ecdc_celery_tasks << (B,orchid) Boundary >> { - task_ecdc_download_only() - task_ecdc_import_only() - task_ecdc_update_dimension_tables_only() - task_ecdc_update_fact_table_initial_only() - task_ecdc_update_fact_table_incremental_only() - task_ecdc_update_star_schema_initial() - task_ecdc_update_star_schema_incremental() - } } -ApplicationServiceDownload : SQLAlchemy database -EcdcServiceImport : SQLAlchemy database -EcdcServiceUpdate : SQLAlchemy database -EcdcService : SQLAlchemy database -ApplicationDateReported <|-- EcdcDateReported -ApplicationRegion <|-- EcdcContinent + +AllDateReported <|-- EcdcDateReported +AllLocationGroup <|-- EcdcContinent +AllLocation <|-- EcdcCountry + EcdcCountry "1" *--> "*" EcdcContinent: continent EcdcData "1" *--> "*" EcdcCountry: country EcdcData "1" *--> "*" EcdcDateReported: date_reported -EcdcService "*" *--> "1" ApplicationServiceConfig: cfg -EcdcServiceImport "*" --> "1" ApplicationServiceConfig: cfg -EcdcServiceUpdate "*" --> "1" ApplicationServiceConfig: cfg -EcdcService "1" *--> "1" EcdcServiceImport: ecdc_service_import -EcdcService "1" *--> "1" EcdcServiceUpdate: ecdc_service_update -EcdcService "1" *--> "1" ApplicationServiceDownload: service_download -ecdc_views_frontend "1" --> "1" EcdcService: ecdc_service -ecdc_views_for_tasks "1" --> "1" EcdcService: ecdc_service -ecdc_celery_tasks "1" --> "1" EcdcService: ecdc_service -AllImportFull <|-- DataImport -AllImportIncrement <|-- DataImport -DataImport <|-- AllFlat -DataImport <|-- EcdcImport -AllFlat <|-- EcdcFlat -EcdcImport <|-- EcdcFlat + @enduml diff --git a/docs/blueprints/owid/uml/owid_domain_model_import.puml b/docs/blueprints/owid/uml/owid_domain_model_import.puml index bf44bc8a..dc974871 100644 --- a/docs/blueprints/owid/uml/owid_domain_model_import.puml +++ b/docs/blueprints/owid/uml/owid_domain_model_import.puml @@ -1,7 +1,7 @@ @startuml left to right direction -package covid19.blueprints.all { +package covid19.blueprints.all.model_import { interface AllImportFull { {classifier} download_file() @@ -59,7 +59,7 @@ package covid19.blueprints.all { } -package covid19.blueprints.owid { +package covid19.blueprints.owid.model_import { entity OwidImport { id: Integer @@ -216,10 +216,12 @@ package covid19.blueprints.owid { } } + AllImportFull <|-- DataImport AllImportIncrement <|-- DataImport DataImport <|-- AllFlat DataImport <|-- 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 65f46599..e7af9454 100644 --- a/docs/blueprints/owid/uml/owid_domain_model_star_schema.puml +++ b/docs/blueprints/owid/uml/owid_domain_model_star_schema.puml @@ -1,263 +1,61 @@ @startuml left to right direction -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() - } +package covid19.blueprints.all.model { - interface AllFlat { + interface AllDateReported { id: Integer - datum_reported: Date + date_reported: String + year_week: String + datum: 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[] + 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) } -} -package covid19.blueprints.owid.model_import { - entity OwidImport { + interface AllLocationGroup { id: Integer - iso_code: String continent: String - location: String - date: String - total_cases: String - new_cases: String - new_cases_smoothed: String - total_deaths: String - new_deaths: String - new_deaths_smoothed: String - total_cases_per_million: String - new_cases_per_million: String - new_cases_smoothed_per_million: String - total_deaths_per_million: String - new_deaths_per_million: String - new_deaths_smoothed_per_million: String - reproduction_rate: String - icu_patients: String - icu_patients_per_million: String - hosp_patients: String - hosp_patients_per_million: String - weekly_icu_admissions: String - weekly_icu_admissions_per_million: String - weekly_hosp_admissions: String - weekly_hosp_admissions_per_million: String - new_tests: String - total_tests: String - total_tests_per_thousand: String - new_tests_per_thousand: String - new_tests_smoothed: String - new_tests_smoothed_per_thousand: String - positive_rate: String - tests_per_case: String - tests_units: String - total_vaccinations: String - people_vaccinated: String - people_fully_vaccinated: String - new_vaccinations: String - new_vaccinations_smoothed: String - total_vaccinations_per_hundred: String - people_vaccinated_per_hundred: String - people_fully_vaccinated_per_hundred: String - new_vaccinations_smoothed_per_million: String - stringency_index: String - population: String - population_density: String - median_age: String - aged_65_older: String - aged_70_older: String - gdp_per_capita: String - extreme_poverty: String - cardiovasc_death_rate: String - diabetes_prevalence: String - female_smokers: String - male_smokers: String - handwashing_facilities: String - hospital_beds_per_thousand: String - life_expectancy: String - human_development_index: 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) - {classifier} get_dates() - {classifier} get_for_one_day(day: String) - {classifier} get_dates_reported_as_array() - {classifier} get_new_dates_reported_as_array() - {classifier} get_continents(page: Integer) - {classifier} get_all_continents() } - - entity OwidFlat { + interface AllLocation { + id: Integer + } + interface AllData { 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 - iso_code: String - continent: String - location: String - date: String - total_cases: String - new_cases: String - new_cases_smoothed: String - total_deaths: String - new_deaths: String - new_deaths_smoothed: String - total_cases_per_million: String - new_cases_per_million: String - new_cases_smoothed_per_million: String - total_deaths_per_million: String - new_deaths_per_million: String - new_deaths_smoothed_per_million: String - reproduction_rate: String - icu_patients: String - icu_patients_per_million: String - hosp_patients: String - hosp_patients_per_million: String - weekly_icu_admissions: String - weekly_icu_admissions_per_million: String - weekly_hosp_admissions: String - weekly_hosp_admissions_per_million: String - new_tests: String - total_tests: String - total_tests_per_thousand: String - new_tests_per_thousand: String - new_tests_smoothed: String - new_tests_smoothed_per_thousand: String - positive_rate: String - tests_per_case: String - tests_units: String - total_vaccinations: String - people_vaccinated: String - people_fully_vaccinated: String - new_vaccinations: String - new_vaccinations_smoothed: String - total_vaccinations_per_hundred: String - people_vaccinated_per_hundred: String - people_fully_vaccinated_per_hundred: String - new_vaccinations_smoothed_per_million: String - stringency_index: String - population: String - population_density: String - median_age: String - aged_65_older: String - aged_70_older: String - gdp_per_capita: String - extreme_poverty: String - cardiovasc_death_rate: String - diabetes_prevalence: String - female_smokers: String - male_smokers: String - handwashing_facilities: String - hospital_beds_per_thousand: String - life_expectancy: String - human_development_index: 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): OwidFlat[] - {classifier} get_data_for_day(datum_reported: Date): OwidFlat[] } } - -package covid19.blueprints.all.model { - entity AllDateReported {} - entity AllLocationGroup {} - entity AllLocation {} - entity AllData {} -} - package covid19.blueprints.owid.model { - entity OwidDateReported {} - entity OwidContinent {} - entity OwidCountry {} - entity OwidData {} -} - -package covid19.blueprints.all.service { - class AllServiceDownload << (S,red) Service >> {} - class AllServiceConfig << (S,red) Service >> {} -} - -package covid19.blueprints.owid.service { - class OwidServiceImport << (S,red) Service >> { - import_file() + entity OwidDateReported { + id: Integer + } + entity OwidContinent { + id: Integer + } + entity OwidCountry { + id: Integer + } + entity OwidData { + id: Integer } - class OwidService << (S,red) Service >> {} -} - -package covid19.blueprints.owid.views { - class owid_views_frontend << (B,orchid) Boundary >> {} - class owid_views_for_tasks << (B,orchid) Boundary >> {} - class owid_celery_tasks << (B,orchid) Boundary >> {} } -AllImportFull <|-- AllImport -AllImportIncrement <|-- AllImport -AllImport <|-- AllFlat -AllFlat <|-- OwidFlat - -AllImport <|-- OwidImport -OwidImport <|-- OwidFlat - AllDateReported <|-- OwidDateReported AllLocationGroup <|-- OwidContinent AllLocation <|-- OwidCountry @@ -267,18 +65,4 @@ OwidCountry "1" *--> "*" OwidContinent : region OwidData "1" *--> "*" OwidCountry : country OwidData "1" *--> "*" OwidDateReported : date_reported -OwidServiceImport : SQLAlchemy database -OwidService : SQLAlchemy database -AllServiceDownload : SQLAlchemy database - -OwidService "*" *--> "1" AllServiceConfig : cfg -OwidServiceImport "*" --> "1" AllServiceConfig : cfg - -OwidService "1" *--> "1" OwidServiceImport : owid_service_import -OwidService "1" *--> "1" AllServiceDownload : owid_service_dowload - -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 - @enduml diff --git a/docs/blueprints/rki_cases/uml/rki_cases_domain_model.puml b/docs/blueprints/rki_cases/uml/rki_cases_domain_model.puml index 5ea5ed06..92bb0364 100644 --- a/docs/blueprints/rki_cases/uml/rki_cases_domain_model.puml +++ b/docs/blueprints/rki_cases/uml/rki_cases_domain_model.puml @@ -1,51 +1,6 @@ @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 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 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 AllData { - id: Integer - } -} package covid19.blueprints.all.model_import { @@ -102,6 +57,7 @@ package covid19.blueprints.all.model_import { {classifier} get_data_for_location(location: String): AllFlat[] {classifier} get_data_for_day(datum_reported: Date): AllFlat[] } + } package covid19.blueprints.rki_cases.model_import { @@ -177,6 +133,55 @@ package covid19.blueprints.rki_cases.model_import { {classifier} get_data_for_location(location: String): RkiCasesFlat[] {classifier} get_data_for_day(datum_reported: Date): RkiCasesFlat[] } + +} + +AllImportFull <|-- AllImport +AllImportIncrement <|-- AllImport +AllImport <|-- AllFlat +AllImport <|-- RkiImport +AllFlat <|-- RkiFlat +RkiImport <|-- RkiFlat + + + +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 + } + interface AllData { + id: Integer + } } package covid19.blueprints.rki_cases.model { @@ -198,6 +203,7 @@ package covid19.blueprints.rki_cases.model { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } + entity RkiBundesland { id: Integer id_bundesland: String @@ -221,6 +227,7 @@ package covid19.blueprints.rki_cases.model { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } + entity RkiData { id: Integer fid: String @@ -250,13 +257,6 @@ package covid19.blueprints.rki_cases.model { } } -AllImportFull <|-- AllImport -AllImportIncrement <|-- AllImport -AllImport <|-- AllFlat -AllImport <|-- RkiImport -AllFlat <|-- RkiFlat -RkiImport <|-- RkiFlat - AllDateReported <|-- RkiMeldedatum AllLocationGroup <|-- RkiBundesland AllLocation <|-- RkiLandkreis @@ -265,4 +265,5 @@ AllData <|-- RkiData RkiLandkreis "1" *--> "*" RkiBundesland : bundesland RkiData "1" *--> "*" RkiLandkreis : landkreis RkiData "1" *--> "*" RkiMeldedatum : meldedatum + @enduml diff --git a/docs/blueprints/rki_cases/uml/rki_cases_domain_model_import.puml b/docs/blueprints/rki_cases/uml/rki_cases_domain_model_import.puml index fc93a1b5..c9e3db9d 100644 --- a/docs/blueprints/rki_cases/uml/rki_cases_domain_model_import.puml +++ b/docs/blueprints/rki_cases/uml/rki_cases_domain_model_import.puml @@ -1,7 +1,7 @@ @startuml left to right direction -package covid19.blueprints.all { +package covid19.blueprints.all.model_import { interface AllImportFull { {classifier} download_file() @@ -19,7 +19,7 @@ package covid19.blueprints.all { {classifier} update_star_schema() } - interface DataImport { + interface AllImport { datum_reported: Date location: String location_group: String @@ -59,7 +59,7 @@ package covid19.blueprints.all { } -package covid19.blueprints.rki_cases { +package covid19.blueprints.rki_cases.model_import { entity RkiImport { id: Integer @@ -135,10 +135,11 @@ package covid19.blueprints.rki_cases { } -AllImportFull <|-- DataImport -AllImportIncrement <|-- DataImport -DataImport <|-- AllFlat -DataImport <|-- RkiImport +AllImportFull <|-- AllImport +AllImportIncrement <|-- AllImport +AllImport <|-- AllFlat +AllImport <|-- RkiImport AllFlat <|-- RkiFlat RkiImport <|-- RkiFlat + @enduml 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 9a2a3137..2342882f 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 @@ -21,24 +21,7 @@ package covid19.blueprints.all.model { {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 - 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 @@ -55,137 +38,10 @@ package covid19.blueprints.all.model { 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.rki_cases.model { - entity RkiImport { - id: Integer - fid: String - id_bundesland: String - bundesland: String - landkreis: String - altersgruppe: String - geschlecht: String - anzahl_fall: String - anzahl_todesfall: String - meldedatum: String - id_landkreis: String - datenstand: String - neuer_fall: String - neuer_todesfall: String - ref_datum: String - neu_genesen: String - anzahl_genesen: String - ist_erkrankungsbeginn: String - altersgruppe2: 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() - } - - entity RkiFlat { - 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 - fid: String - id_bundesland: String - bundesland: String - landkreis: String - altersgruppe: String - geschlecht: String - anzahl_fall: String - anzahl_todesfall: String - meldedatum: String - id_landkreis: String - datenstand: String - neuer_fall: String - neuer_todesfall: String - ref_datum: String - neu_genesen: String - anzahl_genesen: String - ist_erkrankungsbeginn: String - altersgruppe2: 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): RkiCasesFlat[] - {classifier} get_data_for_day(datum_reported: Date): RkiCasesFlat[] - } - entity RkiMeldedatum { id: Integer date_reported: String @@ -203,6 +59,7 @@ package covid19.blueprints.rki_cases.model { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } + entity RkiBundesland { id: Integer id_bundesland: String @@ -226,6 +83,7 @@ package covid19.blueprints.rki_cases.model { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } + entity RkiData { id: Integer fid: String @@ -255,92 +113,6 @@ package covid19.blueprints.rki_cases.model { } } -package covid19.blueprints.all.service { - class AllServiceConfig {} - class AllServiceDownload {} -} - -package covid19.blueprints.rki_cases.service { - - class RkiServiceImport << (S,red) Service >> { - import_file() - } - class RkiServiceUpdateBase << (S,red) Service >> { - } - class RkiServiceUpdateFull << (S,red) Service >> { - -full_update_date_reported() - -full_update_continent() - -full_update_country() - -full_update_fact_table() - -full_update_dimension_tables() - full_update_dimension_tables() - full_update_fact_table() - full_update_star_schema() - } - class RkiServiceUpdate << (S,red) Service >> { - -update_date_reported() - -full_update_continent() - -full_update_country() - -update_fact_table() - -update_dimension_tables() - update_dimension_tables() - update_fact_table() - update_star_schema() - -get_new_dates_reported_from_import() - } - class RkiService << (S,red) Service >> { - pretask_database_drop_create() - task_database_drop_create() - run_download_only() - run_import_only() - run_update_dimension_tables_only() - run_update_fact_table_incremental_only() - run_update_fact_table_initial_only() - run_update_star_schema_incremental() - run_update_star_schema_initial() - download_all_files() - task_import_all_files() - update_dimension_tables_only() - 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() - url_get_years() - url_get_days() - url_get_days_for_year() - url_get_location_groups() - url_get_locations_for_location_group(location_group: str) - url_get_data_for_location() - url_get_data_for_day() - url_page_info() - url_page_tasks() - } - class rki_cases_celery_tasks << (B,orchid) Boundary >> { - task_download_file() - task_import_file() - task_import_file_flat() - task_full_update_dimension_tables() - task_full_update_fact_table() - task_full_update_star_schema() - task_update_dimension_tables() - task_update_fact_table() - task_update_star_schema() - } -} - -AllImportFull <|-- AllImport -AllImportIncrement <|-- AllImport -AllImport <|-- AllFlat -AllFlat <|-- RkiFlat - -AllImport <|-- RkiImport -RkiImport <|-- RkiFlat AllDateReported <|-- RkiMeldedatum AllLocationGroup <|-- RkiBundesland AllLocation <|-- RkiLandkreis @@ -350,27 +122,4 @@ 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 - -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" AllServiceDownload : service_download - -rki_cases_views_frontend "1" --> "1" RkiService : rki_service -rki_cases_celery_tasks "1" --> "1" RkiService : rki_service - @enduml diff --git a/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model.puml b/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model.puml index 1286b52d..8ce338e0 100644 --- a/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model.puml +++ b/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model.puml @@ -1,76 +1,67 @@ @startuml left to right direction -package covid19.blueprints.all { - entity ApplicationDateReported { - id: Integer - date_reported: String - year_week: String - datum: Date - year: Integer - month: Integer - day_of_year: 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) +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() } - class ApplicationServiceDownload << (S,red) Service >> { - -log_error() - -log_success() - -prepare_download() - -download_with_wget() - -download_with_subprocess_and_os_native_wget() - download_file() + + interface AllImportIncrement { + {classifier} download_file() + {classifier} import_file() + {classifier} update_dimension_tables() + {classifier} update_fact_table() + {classifier} update_star_schema() } - 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 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() } -} -package covid19.blueprints.rki_vVaccination { - entity RkiVaccinationDateReported { + + 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) + 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[] } - entity RkiVaccinationData { +} + +package covid19.blueprints.rki_vVaccination.model_import { + + entity RkiVaccinationImport { id: Integer dosen_kumulativ: Integer dosen_differenz_zum_vortag: Integer @@ -92,49 +83,17 @@ package covid19.blueprints.rki_vVaccination { indikation_beruf_voll: Integer indikation_medizinisch_voll: Integer indikation_pflegeheim_voll: Integer - get_absolute_path() - get_relative_path() - {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) - {classifier} get_kurse_all() + date_reported: 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() } - entity RkiVaccinationImport { - datum: String - dosen_kumulativ: Integer - dosen_differenz_zum_vortag: Integer - dosen_biontech_kumulativ: Integer - dosen_moderna_kumulativ: Integer - personen_erst_kumulativ: Integer - personen_voll_kumulativ: Integer - impf_quote_erst: Float - impf_quote_voll: Float - indikation_alter_dosen: Integer - indikation_beruf_dosen: Integer - indikation_medizinisch_dosen: Integer - indikation_pflegeheim_dosen: Integer - indikation_alter_erst: Integer - indikation_beruf_erst: Integer - indikation_medizinisch_erst: Integer - indikation_pflegeheim_erst: Integer - indikation_alter_voll: Integer - indikation_beruf_voll: Integer - indikation_medizinisch_voll: Integer - indikation_pflegeheim_voll: Integer - {classifier} remove_all() - {classifier} get_all_as_page(page: Integer) - {classifier} get_all() - {classifier} get_by_id(other_id: Integer) - {classifier} find_by_id(other_id: Integer) - {classifier} find_by_datum(other_datum: String) - {classifier} get_date_rep() - {classifier} get_date_reported_as_array() - {classifier} get_daterep_missing_in_vaccination_data() - } entity RkiVaccinationFlat { id: Integer datum_reported: Date @@ -179,77 +138,101 @@ package covid19.blueprints.rki_vVaccination { {classifier} get_data_for_location(location: String): RkiVaccinationFlat[] {classifier} get_data_for_day(datum_reported: Date): RkiVaccinationFlat[] } - class RkiVaccinationService << (S,red) Service >> { - pretask_database_drop_create() - task_database_drop_create() - run_download_only() - run_import_only() - run_update_dimension_tables_only() - run_update_fact_table_incremental_only() - run_update_fact_table_initial_only() - run_update_star_schema_incremental() - run_update_star_schema_initial() - download_all_files() - task_import_all_files() - update_dimension_tables_only() - update_fact_table_initial_only() - update_fact_table_incremental_only() - } - class RkiVaccinationServiceImport << (S,red) Service >> { - import_file() - } - class RkiVaccinationServiceUpdate << (S,red) Service >> { - -update_date_reported() - -update_region() - -update_country() - -update_data_incremental() - -update_data_initial() - -update_dimension_tables() - update_dimension_tables_only() - update_fact_table_incremental_only() - update_fact_table_initial_only() - update_star_schema_incremental() - update_star_schema_initial() +} + +AllImportFull <|-- AllImport +AllImportIncrement <|-- AllImport +AllImport <|-- AllFlat +AllImport <|-- RkiVaccinationImport +AllFlat <|-- RkiVaccinationFlat +RkiVaccinationImport <|-- RkiVaccinationFlat + + +package covid19.blueprints.all.model { + + entity AllDateReported { + id: Integer + date_reported: String + year_week: String + datum: Date + year: Integer + month: Integer + day_of_year: 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) } - class rki_vaccination_views_frontend << (B,orchid) Boundary >> { - url_vaccination_info() - url_vaccination_tasks() - url_vaccination_imported() - url_vaccination_data() + + interface AllData { + id: Integer } - class rki_vaccination_views_for_tasks << (B,orchid) Boundary >> { - task_who_download_only() - task_who_import_only() - task_who_update_dimension_tables_only() - task_who_update_fact_table_initial_only() - task_who_update_fact_table_incremental_only() - task_who_update_star_schema_initial() - task_who_update_star_schema_incremental() +} + +package covid19.blueprints.rki_vaccination.model { + + entity RkiVaccinationDateReported { + 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) } - class rki_vaccination_celery_tasks << (B,orchid) Boundary >> { - url_vaccination_task_download_only() - url_vaccination_task_import_only() - url_vaccination_task_update_dimensiontables_only() - url_vaccination_task_update_facttable_incremental_only() - url_vaccination_task_update_facttable_initial_only() - url_vaccination_task_update_starschema_initial() - url_vaccination_task_update_starschema_incremental() + + entity RkiVaccinationData { + id: Integer + dosen_kumulativ: Integer + dosen_differenz_zum_vortag: Integer + dosen_biontech_kumulativ: Integer + dosen_moderna_kumulativ: Integer + personen_erst_kumulativ: Integer + personen_voll_kumulativ: Integer + impf_quote_erst: Float + impf_quote_voll: Float + indikation_alter_dosen: Integer + indikation_beruf_dosen: Integer + indikation_medizinisch_dosen: Integer + indikation_pflegeheim_dosen: Integer + indikation_alter_erst: Integer + indikation_beruf_erst: Integer + indikation_medizinisch_erst: Integer + indikation_pflegeheim_erst: Integer + indikation_alter_voll: Integer + indikation_beruf_voll: Integer + indikation_medizinisch_voll: Integer + indikation_pflegeheim_voll: Integer + get_absolute_path() + get_relative_path() + {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) + {classifier} get_kurse_all() } } -RkiVaccinationServiceImport : SQLAlchemy database -RkiVaccinationServiceUpdate : SQLAlchemy database -RkiVaccinationService : SQLAlchemy database -ApplicationServiceDownload : SQLAlchemy database -ApplicationDateReported <|-- RkiVaccinationDateReported + +AllDateReported <|-- RkiVaccinationDateReported +AllData <|-- RkiVaccinationData + RkiVaccinationData "1" *--> "*" RkiVaccinationDateReported : date_reported -RkiVaccinationService "*" *--> "1" ApplicationServiceConfig : cfg -RkiVaccinationServiceImport "*" --> "1" ApplicationServiceConfig : cfg -RkiVaccinationServiceUpdate "*" --> "1" ApplicationServiceConfig : cfg -ApplicationServiceDownload "*" --> "1" ApplicationServiceConfig : cfg -RkiVaccinationService "1" *--> "1" RkiVaccinationServiceImport : rki_vaccination_service_import -RkiVaccinationService "1" *--> "1" RkiVaccinationServiceUpdate : rki_vaccination_service_update -RkiVaccinationService "1" *--> "1" ApplicationServiceDownload : service_download -rki_vaccination_views_frontend "1" --> "1" RkiVaccinationService : rki_vaccination_service -rki_vaccination_views_for_tasks "1" --> "1" RkiVaccinationService : rki_vaccination_service -rki_vaccination_celery_tasks "1" --> "1" RkiVaccinationService : rki_vaccination_service + @enduml diff --git a/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model_import.puml b/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model_import.puml index 5bb53954..9d4c357d 100644 --- a/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model_import.puml +++ b/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model_import.puml @@ -1,141 +1,148 @@ @startuml left to right direction -interface AllImportFull { - {classifier} download_file() - {classifier} import_file() - {classifier} full_update_dimension_tables() - {classifier} full_update_fact_table() - {classifier} full_update_star_schema() -} +package covid19.blueprints.all.model_import { -interface AllImportIncrement { - {classifier} download_file() - {classifier} import_file() - {classifier} update_dimension_tables() - {classifier} update_fact_table() - {classifier} update_star_schema() -} + interface AllImportFull { + {classifier} download_file() + {classifier} import_file() + {classifier} full_update_dimension_tables() + {classifier} full_update_fact_table() + {classifier} full_update_star_schema() + } -interface DataImport { - 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 AllImportIncrement { + {classifier} download_file() + {classifier} import_file() + {classifier} update_dimension_tables() + {classifier} update_fact_table() + {classifier} update_star_schema() + } -entity RkiVaccinationImport { - id: Integer - dosen_kumulativ: Integer - dosen_differenz_zum_vortag: Integer - dosen_biontech_kumulativ: Integer - dosen_moderna_kumulativ: Integer - personen_erst_kumulativ: Integer - personen_voll_kumulativ: Integer - impf_quote_erst: Float - impf_quote_voll: Float - indikation_alter_dosen: Integer - indikation_beruf_dosen: Integer - indikation_medizinisch_dosen: Integer - indikation_pflegeheim_dosen: Integer - indikation_alter_erst: Integer - indikation_beruf_erst: Integer - indikation_medizinisch_erst: Integer - indikation_pflegeheim_erst: Integer - indikation_alter_voll: Integer - indikation_beruf_voll: Integer - indikation_medizinisch_voll: Integer - indikation_pflegeheim_voll: Integer - date_reported: 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 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[] + 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[] + } } -entity RkiVaccinationFlat { - 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 - dosen_kumulativ: Integer - dosen_differenz_zum_vortag: Integer - dosen_biontech_kumulativ: Integer - dosen_moderna_kumulativ: Integer - personen_erst_kumulativ: Integer - personen_voll_kumulativ: Integer - impf_quote_erst: Float - impf_quote_voll: Float - indikation_alter_dosen: Integer - indikation_beruf_dosen: Integer - indikation_medizinisch_dosen: Integer - indikation_pflegeheim_dosen: Integer - indikation_alter_erst: Integer - indikation_beruf_erst: Integer - indikation_medizinisch_erst: Integer - indikation_pflegeheim_erst: Integer - indikation_alter_voll: Integer - indikation_beruf_voll: Integer - indikation_medizinisch_voll: Integer - indikation_pflegeheim_voll: Integer - date_reported: 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): RkiVaccinationFlat[] - {classifier} get_data_for_day(datum_reported: Date): RkiVaccinationFlat[] +package covid19.blueprints.rki_vVaccination.model_import { + + entity RkiVaccinationImport { + id: Integer + dosen_kumulativ: Integer + dosen_differenz_zum_vortag: Integer + dosen_biontech_kumulativ: Integer + dosen_moderna_kumulativ: Integer + personen_erst_kumulativ: Integer + personen_voll_kumulativ: Integer + impf_quote_erst: Float + impf_quote_voll: Float + indikation_alter_dosen: Integer + indikation_beruf_dosen: Integer + indikation_medizinisch_dosen: Integer + indikation_pflegeheim_dosen: Integer + indikation_alter_erst: Integer + indikation_beruf_erst: Integer + indikation_medizinisch_erst: Integer + indikation_pflegeheim_erst: Integer + indikation_alter_voll: Integer + indikation_beruf_voll: Integer + indikation_medizinisch_voll: Integer + indikation_pflegeheim_voll: Integer + date_reported: 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() + } + + entity RkiVaccinationFlat { + 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 + dosen_kumulativ: Integer + dosen_differenz_zum_vortag: Integer + dosen_biontech_kumulativ: Integer + dosen_moderna_kumulativ: Integer + personen_erst_kumulativ: Integer + personen_voll_kumulativ: Integer + impf_quote_erst: Float + impf_quote_voll: Float + indikation_alter_dosen: Integer + indikation_beruf_dosen: Integer + indikation_medizinisch_dosen: Integer + indikation_pflegeheim_dosen: Integer + indikation_alter_erst: Integer + indikation_beruf_erst: Integer + indikation_medizinisch_erst: Integer + indikation_pflegeheim_erst: Integer + indikation_alter_voll: Integer + indikation_beruf_voll: Integer + indikation_medizinisch_voll: Integer + indikation_pflegeheim_voll: Integer + date_reported: 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): RkiVaccinationFlat[] + {classifier} get_data_for_day(datum_reported: Date): RkiVaccinationFlat[] + } } -AllImportFull <|-- DataImport -AllImportIncrement <|-- DataImport -DataImport <|-- AllFlat -DataImport <|-- RkiVaccinationImport + +AllImportFull <|-- AllImport +AllImportIncrement <|-- AllImport +AllImport <|-- AllFlat +AllImport <|-- RkiVaccinationImport AllFlat <|-- RkiVaccinationFlat RkiVaccinationImport <|-- RkiVaccinationFlat @enduml diff --git a/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model_star_schema.puml b/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model_star_schema.puml index 1286b52d..f0905b1e 100644 --- a/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model_star_schema.puml +++ b/docs/blueprints/rki_vaccination/uml/rki_vaccination_domain_model_star_schema.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 @@ -22,36 +22,14 @@ package covid19.blueprints.all { {classifier} my_year_week(my_iso_year: Integer, week_number: Integer) {classifier} create_new_object_factory(my_date_rep: String) } - 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 AllData { + id: Integer } } -package covid19.blueprints.rki_vVaccination { + +package covid19.blueprints.rki_vaccination.model { + entity RkiVaccinationDateReported { id: Integer date_reported: String @@ -70,6 +48,7 @@ package covid19.blueprints.rki_vVaccination { {classifier} my_year_week(my_iso_year: Integer, week_number: Integer) {classifier} create_new_object_factory(my_date_rep: String) } + entity RkiVaccinationData { id: Integer dosen_kumulativ: Integer @@ -102,154 +81,11 @@ package covid19.blueprints.rki_vVaccination { {classifier} find_by_id(other_id: Integer) {classifier} get_kurse_all() } - entity RkiVaccinationImport { - datum: String - dosen_kumulativ: Integer - dosen_differenz_zum_vortag: Integer - dosen_biontech_kumulativ: Integer - dosen_moderna_kumulativ: Integer - personen_erst_kumulativ: Integer - personen_voll_kumulativ: Integer - impf_quote_erst: Float - impf_quote_voll: Float - indikation_alter_dosen: Integer - indikation_beruf_dosen: Integer - indikation_medizinisch_dosen: Integer - indikation_pflegeheim_dosen: Integer - indikation_alter_erst: Integer - indikation_beruf_erst: Integer - indikation_medizinisch_erst: Integer - indikation_pflegeheim_erst: Integer - indikation_alter_voll: Integer - indikation_beruf_voll: Integer - indikation_medizinisch_voll: Integer - indikation_pflegeheim_voll: Integer - - {classifier} remove_all() - {classifier} get_all_as_page(page: Integer) - {classifier} get_all() - {classifier} get_by_id(other_id: Integer) - {classifier} find_by_id(other_id: Integer) - {classifier} find_by_datum(other_datum: String) - {classifier} get_date_rep() - {classifier} get_date_reported_as_array() - {classifier} get_daterep_missing_in_vaccination_data() - } - entity RkiVaccinationFlat { - 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 - dosen_kumulativ: Integer - dosen_differenz_zum_vortag: Integer - dosen_biontech_kumulativ: Integer - dosen_moderna_kumulativ: Integer - personen_erst_kumulativ: Integer - personen_voll_kumulativ: Integer - impf_quote_erst: Float - impf_quote_voll: Float - indikation_alter_dosen: Integer - indikation_beruf_dosen: Integer - indikation_medizinisch_dosen: Integer - indikation_pflegeheim_dosen: Integer - indikation_alter_erst: Integer - indikation_beruf_erst: Integer - indikation_medizinisch_erst: Integer - indikation_pflegeheim_erst: Integer - indikation_alter_voll: Integer - indikation_beruf_voll: Integer - indikation_medizinisch_voll: Integer - indikation_pflegeheim_voll: Integer - date_reported: 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): RkiVaccinationFlat[] - {classifier} get_data_for_day(datum_reported: Date): RkiVaccinationFlat[] - } - class RkiVaccinationService << (S,red) Service >> { - pretask_database_drop_create() - task_database_drop_create() - run_download_only() - run_import_only() - run_update_dimension_tables_only() - run_update_fact_table_incremental_only() - run_update_fact_table_initial_only() - run_update_star_schema_incremental() - run_update_star_schema_initial() - download_all_files() - task_import_all_files() - update_dimension_tables_only() - update_fact_table_initial_only() - update_fact_table_incremental_only() - } - class RkiVaccinationServiceImport << (S,red) Service >> { - import_file() - } - class RkiVaccinationServiceUpdate << (S,red) Service >> { - -update_date_reported() - -update_region() - -update_country() - -update_data_incremental() - -update_data_initial() - -update_dimension_tables() - update_dimension_tables_only() - update_fact_table_incremental_only() - update_fact_table_initial_only() - update_star_schema_incremental() - update_star_schema_initial() - } - class rki_vaccination_views_frontend << (B,orchid) Boundary >> { - url_vaccination_info() - url_vaccination_tasks() - url_vaccination_imported() - url_vaccination_data() - } - class rki_vaccination_views_for_tasks << (B,orchid) Boundary >> { - task_who_download_only() - task_who_import_only() - task_who_update_dimension_tables_only() - task_who_update_fact_table_initial_only() - task_who_update_fact_table_incremental_only() - task_who_update_star_schema_initial() - task_who_update_star_schema_incremental() - } - class rki_vaccination_celery_tasks << (B,orchid) Boundary >> { - url_vaccination_task_download_only() - url_vaccination_task_import_only() - url_vaccination_task_update_dimensiontables_only() - url_vaccination_task_update_facttable_incremental_only() - url_vaccination_task_update_facttable_initial_only() - url_vaccination_task_update_starschema_initial() - url_vaccination_task_update_starschema_incremental() - } } -RkiVaccinationServiceImport : SQLAlchemy database -RkiVaccinationServiceUpdate : SQLAlchemy database -RkiVaccinationService : SQLAlchemy database -ApplicationServiceDownload : SQLAlchemy database -ApplicationDateReported <|-- RkiVaccinationDateReported + +AllDateReported <|-- RkiVaccinationDateReported +AllData <|-- RkiVaccinationData + RkiVaccinationData "1" *--> "*" RkiVaccinationDateReported : date_reported -RkiVaccinationService "*" *--> "1" ApplicationServiceConfig : cfg -RkiVaccinationServiceImport "*" --> "1" ApplicationServiceConfig : cfg -RkiVaccinationServiceUpdate "*" --> "1" ApplicationServiceConfig : cfg -ApplicationServiceDownload "*" --> "1" ApplicationServiceConfig : cfg -RkiVaccinationService "1" *--> "1" RkiVaccinationServiceImport : rki_vaccination_service_import -RkiVaccinationService "1" *--> "1" RkiVaccinationServiceUpdate : rki_vaccination_service_update -RkiVaccinationService "1" *--> "1" ApplicationServiceDownload : service_download -rki_vaccination_views_frontend "1" --> "1" RkiVaccinationService : rki_vaccination_service -rki_vaccination_views_for_tasks "1" --> "1" RkiVaccinationService : rki_vaccination_service -rki_vaccination_celery_tasks "1" --> "1" RkiVaccinationService : rki_vaccination_service + @enduml diff --git a/docs/blueprints/who/uml/who_domain_model.puml b/docs/blueprints/who/uml/who_domain_model.puml index 5f473d6a..9fc94a38 100644 --- a/docs/blueprints/who/uml/who_domain_model.puml +++ b/docs/blueprints/who/uml/who_domain_model.puml @@ -1,57 +1,6 @@ @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 { @@ -109,96 +58,7 @@ package covid19.blueprints.all.model_import { {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 { @@ -211,16 +71,6 @@ package covid19.blueprints.who.model_import { 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() @@ -262,135 +112,130 @@ package covid19.blueprints.who.model_import { {classifier} get_data_for_location(location: String): WhoFlat[] {classifier} get_data_for_day(datum_reported: Date): WhoFlat[] } + } +AllImportFull <|-- AllImport +AllImportIncrement <|-- AllImport +AllImport <|-- AllFlat -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 >> { +AllImport <|-- WhoImport +AllFlat <|-- WhoFlat + +WhoImport <|-- WhoFlat + + + +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) } - 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() + + 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) } - 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() + + interface AllLocation { + id: Integer + } + + interface AllData { + id: Integer } + } -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() + +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) } - 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() + + entity WhoCountryRegion { + id: Integer + region: String } - 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() + + entity WhoCountry { + id: Integer + country_code: String + country: 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) } } -WhoServiceImport : SQLAlchemy database -WhoServiceUpdateBase : SQLAlchemy database -WhoServiceUpdateFull <|-- WhoServiceUpdateBase -WhoServiceUpdate <|-- WhoServiceUpdateBase -WhoService : SQLAlchemy database -AllServiceDownload : SQLAlchemy database AllDateReported <|-- WhoDateReported AllLocationGroup <|-- WhoCountryRegion AllLocation <|-- WhoCountry AllData <|-- WhoData +WhoCountry "1" *--> "*" WhoCountryRegion : region +WhoData "1" *--> "*" WhoCountry : country 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 -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_import.puml b/docs/blueprints/who/uml/who_domain_model_import.puml index 342a1daa..3549f540 100644 --- a/docs/blueprints/who/uml/who_domain_model_import.puml +++ b/docs/blueprints/who/uml/who_domain_model_import.puml @@ -1,5 +1,6 @@ @startuml left to right direction + package covid19.blueprints.all.model_import { interface AllImportFull { 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 2768c3ac..135b736f 100644 --- a/docs/blueprints/who/uml/who_domain_model_star_schema.puml +++ b/docs/blueprints/who/uml/who_domain_model_star_schema.puml @@ -1,5 +1,6 @@ @startuml left to right direction + package covid19.blueprints.all.model { interface AllDateReported { @@ -20,24 +21,7 @@ package covid19.blueprints.all.model { {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 - 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 @@ -48,66 +32,15 @@ package covid19.blueprints.all.model { {classifier} get_by_id(other_id: Integer) {classifier} find_by_id(other_id: Integer) } + 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.who.model { @@ -124,10 +57,12 @@ package covid19.blueprints.who.model { week_of_year: Integer {classifier} create_new_object_factory(my_date_rep) } + entity WhoCountryRegion { id: Integer region: String } + entity WhoCountry { id: Integer country_code: String @@ -145,6 +80,7 @@ package covid19.blueprints.who.model { {classifier} get_by_country(i_country) {classifier} get_who_countries_for_region(region, page) } + entity WhoData { id: Integer cases_new: Integer @@ -167,74 +103,8 @@ package covid19.blueprints.who.model { {classifier} get_data_for_country_order_by_deaths_new(who_country, page) {classifier} get_data_for_country_order_by_deaths_cumulative(who_country, page) } - 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[] - } } -AllImportFull <|-- AllImport -AllImportIncrement <|-- AllImport - -AllImport <|-- WhoImport -AllFlat <|-- WhoFlat - AllDateReported <|-- WhoDateReported AllLocationGroup <|-- WhoCountryRegion AllLocation <|-- WhoCountry -- GitLab