diff --git a/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model.png b/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model.png index 3448f7515022efb23bbb5c821210c1e405eef1b9..3c88b2e7d4cb025fdf5cdbdd3da18b2d3049b9d2 100644 Binary files a/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model.png and b/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model.png differ diff --git a/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model_impl.png b/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model_impl.png index 3448f7515022efb23bbb5c821210c1e405eef1b9..56dbbae6ad364e7420e64e42abe3c431070fb791 100644 Binary files a/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model_impl.png and b/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model_impl.png differ diff --git a/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model_import.png b/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model_import.png index 9b67b121445872c58972f07adf010f151419c875..077094bb6451c70558074cccc03e35f0141ec2ab 100644 Binary files a/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model_import.png and b/docs/blueprints/rki_cases/uml/img/rki_cases_domain_model_import.png differ diff --git a/docs/blueprints/rki_cases/uml/rki_cases_domain_model.txt b/docs/blueprints/rki_cases/uml/rki_cases_domain_model.txt index 789178e0cee45bfa7dde40154bdf2cd96368f566..e2717e6bf34698e4727bbb22b97895999b3f8740 100644 --- a/docs/blueprints/rki_cases/uml/rki_cases_domain_model.txt +++ b/docs/blueprints/rki_cases/uml/rki_cases_domain_model.txt @@ -1,330 +1,352 @@ @startuml -Entity OwidImport { - 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_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() +package covid19.blueprints.all { + + interface 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) + } + interface 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() + } + + 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 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 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 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) +package covid19.blueprints.rki_cases { + + 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 + 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 RkiBundesland { + id: Integer + id_bundesland: String + region: 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 RkiLandkreis { + id: Integer + id_landkreis: String + landkreis: 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 RkiData { + 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} 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 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() + } + 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() + } } -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) -} -class OwidServiceImport << (S,red) Service >> { - import_file() -} -class OwidServiceUpdateBase << (S,red) Service >> { -} -class OwidServiceUpdateFull << (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 OwidServiceUpdate << (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 OwidService << (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() -} -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() -} -class owid_views_frontend << (B,orchid) Boundary >> { - url_owid_info() - url_owid_tasks() - url_owid_test() - url_owid_imported() - url_owid_date_reported_all() - url_owid_date_reported() - url_owid_date_reported_cases_new() - url_owid_date_reported_cases_cumulative() - url_owid_date_reported_deaths_new() - url_owid_date_reported_deaths_cumulative() -} -class owid_views_for_tasks << (B,orchid) Boundary >> { - url_task_owid_download_only() - url_task_owid_import_only() - url_task_owid_update_dimension_tables_only() - url_task_owid_update_fact_table_incremental_only() - url_task_owid_update_fact_table_initial_only() - url_task_owid_update_star_schema_initial() - url_task_owid_update_star_schema_incremental() -} -class owid_celery_tasks << (B,orchid) Boundary >> { - task_owid_download_only() - task_owid_import_only() - task_owid_update_dimension_tables_only() - task_owid_update_fact_table_incremental_only() - task_owid_update_fact_table_initial_only() - task_owid_update_star_schema_incremental() - task_owid_update_star_schema_initial() -} -OwidServiceImport : SQLAlchemy database -OwidServiceUpdateBase : SQLAlchemy database -OwidServiceUpdateFull : SQLAlchemy database -OwidServiceUpdate : SQLAlchemy database -OwidService : SQLAlchemy database +RkiServiceImport : SQLAlchemy database +RkiServiceUpdateBase : SQLAlchemy database +RkiServiceUpdateFull : SQLAlchemy database +RkiServiceUpdate : SQLAlchemy database +RkiService : SQLAlchemy database ApplicationServiceDownload : SQLAlchemy database -OwidServiceUpdateFull <|-- OwidServiceUpdateBase -OwidServiceUpdate <|-- OwidServiceUpdateBase -ApplicationDateReported <|-- OwidDateReported -ApplicationRegion <|-- OwidContinent -OwidCountry "1" *--> "*" OwidContinent : region -OwidData "1" *--> "*" OwidCountry : country -OwidData "1" *--> "*" OwidDateReported : date_reported -OwidService "*" *--> "1" ApplicationServiceConfig : cfg -OwidServiceImport "*" --> "1" ApplicationServiceConfig : cfg -OwidServiceUpdate "*" --> "1" ApplicationServiceConfig : cfg +RkiServiceUpdateBase <|-- RkiServiceUpdateFull +RkiServiceUpdateBase <|-- RkiServiceUpdate +ApplicationDateReported <|-- RkiMeldedatum +ApplicationRegion <|-- RkiBundesland +RkiLandkreis "1" *--> "*" RkiBundesland : bundesland +RkiData "1" *--> "*" RkiLandkreis : landkreis +RkiData "1" *--> "*" RkiMeldedatum : meldedatum +RkiService "*" *--> "1" ApplicationServiceConfig : cfg +RkiServiceImport "*" --> "1" ApplicationServiceConfig : cfg +RkiServiceUpdate "*" --> "1" ApplicationServiceConfig : cfg ApplicationServiceDownload "*" --> "1" ApplicationServiceConfig : cfg -OwidService "1" *--> "1" OwidServiceImport : owid_service_import -OwidService "1" *--> "1" OwidServiceUpdate : owid_service_update -OwidService "1" *--> "1" OwidServiceUpdateFull : owid_service_update -OwidService "1" *--> "1" ApplicationServiceDownload : service_download -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 +RkiService "1" *--> "1" RkiServiceImport : rki_service_import +RkiService "1" *--> "1" RkiServiceUpdate : rki_service_update +RkiService "1" *--> "1" RkiServiceUpdateFull : rki_service_update +RkiService "1" *--> "1" ApplicationServiceDownload : service_download +rki_cases_views_frontend "1" --> "1" RkiService : rki_service +rki_cases_celery_tasks "1" --> "1" RkiService : rki_service +AllImportFull <|-- DataImport +AllImportIncrement <|-- DataImport +DataImport <|-- AllFlat +DataImport <|-- RkiImport +AllFlat <|-- RkiFlat +RkiImport <|-- RkiFlat @enduml diff --git a/docs/blueprints/rki_cases/uml/rki_cases_domain_model_impl.txt b/docs/blueprints/rki_cases/uml/rki_cases_domain_model_impl.txt index 8836cb52b77331ab2d07d78a6e10aeafbd2dfde0..c8b9faa46b1603dee30080d2d0e31623c68265d1 100644 --- a/docs/blueprints/rki_cases/uml/rki_cases_domain_model_impl.txt +++ b/docs/blueprints/rki_cases/uml/rki_cases_domain_model_impl.txt @@ -1,330 +1,359 @@ @startuml -entity OwidImport { - 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_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() + +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 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() + } + + interface AllImportIncrement { + {classifier} download_file() + {classifier} import_file() + {classifier} update_dimension_tables() + {classifier} update_fact_table() + {classifier} 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 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 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) + +package covid19.blueprints.rki_cases { + + 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} 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} 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 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 + 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 RkiBundesland { + id: Integer + id_bundesland: String + region: 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 RkiLandkreis { + id: Integer + id_landkreis: String + landkreis: 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 RkiData { + 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} 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 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() + } + class owid_views_frontend << (B,orchid) Boundary >> { + url_owid_info() + url_owid_tasks() + url_owid_test() + url_owid_imported() + url_owid_date_reported_all() + url_owid_date_reported() + url_owid_date_reported_cases_new() + url_owid_date_reported_cases_cumulative() + url_owid_date_reported_deaths_new() + url_owid_date_reported_deaths_cumulative() + } + class owid_views_for_tasks << (B,orchid) Boundary >> { + url_task_owid_download_only() + url_task_owid_import_only() + url_task_owid_update_dimension_tables_only() + url_task_owid_update_fact_table_incremental_only() + url_task_owid_update_fact_table_initial_only() + url_task_owid_update_star_schema_initial() + url_task_owid_update_star_schema_incremental() + } + class owid_celery_tasks << (B,orchid) Boundary >> { + task_owid_download_only() + task_owid_import_only() + task_owid_update_dimension_tables_only() + task_owid_update_fact_table_incremental_only() + task_owid_update_fact_table_initial_only() + task_owid_update_star_schema_incremental() + task_owid_update_star_schema_initial() + } + } -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) -} -class OwidServiceImport << (S,red) Service >> { - import_file() -} -class OwidServiceUpdateBase << (S,red) Service >> { -} -class OwidServiceUpdateFull << (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 OwidServiceUpdate << (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 OwidService << (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() -} -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() -} -class owid_views_frontend << (B,orchid) Boundary >> { - url_owid_info() - url_owid_tasks() - url_owid_test() - url_owid_imported() - url_owid_date_reported_all() - url_owid_date_reported() - url_owid_date_reported_cases_new() - url_owid_date_reported_cases_cumulative() - url_owid_date_reported_deaths_new() - url_owid_date_reported_deaths_cumulative() -} -class owid_views_for_tasks << (B,orchid) Boundary >> { - url_task_owid_download_only() - url_task_owid_import_only() - url_task_owid_update_dimension_tables_only() - url_task_owid_update_fact_table_incremental_only() - url_task_owid_update_fact_table_initial_only() - url_task_owid_update_star_schema_initial() - url_task_owid_update_star_schema_incremental() -} -class owid_celery_tasks << (B,orchid) Boundary >> { - task_owid_download_only() - task_owid_import_only() - task_owid_update_dimension_tables_only() - task_owid_update_fact_table_incremental_only() - task_owid_update_fact_table_initial_only() - task_owid_update_star_schema_incremental() - task_owid_update_star_schema_initial() -} -OwidServiceImport : SQLAlchemy database -OwidServiceUpdateBase : SQLAlchemy database -OwidServiceUpdateFull : SQLAlchemy database -OwidServiceUpdate : SQLAlchemy database -OwidService : SQLAlchemy database +RkiServiceImport : SQLAlchemy database +RkiServiceUpdateBase : SQLAlchemy database +RkiServiceUpdateFull : SQLAlchemy database +RkiServiceUpdate : SQLAlchemy database +RkiService : SQLAlchemy database ApplicationServiceDownload : SQLAlchemy database -OwidServiceUpdateFull <|-- OwidServiceUpdateBase -OwidServiceUpdate <|-- OwidServiceUpdateBase -ApplicationDateReported <|-- OwidDateReported -ApplicationRegion <|-- OwidContinent -OwidCountry "1" *--> "*" OwidContinent : region -OwidData "1" *--> "*" OwidCountry : country -OwidData "1" *--> "*" OwidDateReported : date_reported -OwidService "*" *--> "1" ApplicationServiceConfig : cfg -OwidServiceImport "*" --> "1" ApplicationServiceConfig : cfg -OwidServiceUpdate "*" --> "1" ApplicationServiceConfig : cfg +RkiServiceUpdateFull <|-- RkiServiceUpdateBase +RkiServiceUpdate <|-- RkiServiceUpdateBase +ApplicationDateReported <|-- RkiMeldedatum +ApplicationRegion <|-- RkiBundesland +RkiLandkreis "1" *--> "*" RkiBundesland : region +RkiData "1" *--> "*" RkiLandkreis : country +RkiData "1" *--> "*" RkiMeldedatum : date_reported +RkiService "*" *--> "1" ApplicationServiceConfig : cfg +RkiServiceImport "*" --> "1" ApplicationServiceConfig : cfg +RkiServiceUpdate "*" --> "1" ApplicationServiceConfig : cfg ApplicationServiceDownload "*" --> "1" ApplicationServiceConfig : cfg -OwidService "1" *--> "1" OwidServiceImport : owid_service_import -OwidService "1" *--> "1" OwidServiceUpdate : owid_service_update -OwidService "1" *--> "1" OwidServiceUpdateFull : owid_service_update -OwidService "1" *--> "1" ApplicationServiceDownload : service_download -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 +RkiService "1" *--> "1" RkiServiceImport : rki_service_import +RkiService "1" *--> "1" RkiServiceUpdate : rki_service_update +RkiService "1" *--> "1" RkiServiceUpdateFull : rki_service_update +RkiService "1" *--> "1" ApplicationServiceDownload : service_download +owid_views_frontend "1" --> "1" RkiService : rki_service +owid_views_for_tasks "1" --> "1" RkiService : rki_service +owid_celery_tasks "1" --> "1" RkiService : rki_service +AllImportFull <|-- DataImport +AllImportIncrement <|-- DataImport +DataImport <|-- AllFlat +DataImport <|-- RkiImport +AllFlat <|-- RkiFlat +RkiImport <|-- RkiFlat @enduml diff --git a/docs/blueprints/rki_cases/uml/rki_cases_domain_model_import.txt b/docs/blueprints/rki_cases/uml/rki_cases_domain_model_import.txt index c9a42987db22412e2152ee798b9dae42854b51d0..2bdda23e66ed1f377379af3d4f4e9448ba4c6661 100644 --- a/docs/blueprints/rki_cases/uml/rki_cases_domain_model_import.txt +++ b/docs/blueprints/rki_cases/uml/rki_cases_domain_model_import.txt @@ -1,135 +1,143 @@ @startuml -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 { -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 RkiCasesImport { - 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() -} + 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 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 RkiCasesFlat { - 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[] +package covid19.blueprints.rki_cases { + + 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[] + } + } AllImportFull <|-- DataImport AllImportIncrement <|-- DataImport DataImport <|-- AllFlat -DataImport <|-- RkiCasesImport -AllFlat <|-- RkiCasesFlat -RkiCasesImport <|-- RkiCasesFlat +DataImport <|-- RkiImport +AllFlat <|-- RkiFlat +RkiImport <|-- RkiFlat @enduml diff --git a/docs/blueprints/who/uml/img/who_domain_model_import.png b/docs/blueprints/who/uml/img/who_domain_model_import.png index 8fe54b4cff9a8c58b9575da2ea624fe551ca2cd6..1cf778646289f071c036b5bb8d76fa8cfa33e324 100644 Binary files a/docs/blueprints/who/uml/img/who_domain_model_import.png and b/docs/blueprints/who/uml/img/who_domain_model_import.png differ diff --git a/docs/blueprints/who/uml/who_domain_model_import.txt b/docs/blueprints/who/uml/who_domain_model_import.txt index 1f410b3d6c58b35916828e8dae8c65c11651fd1b..3f132ec9b2c994981fe7274a89ad2318ca3c0339 100644 --- a/docs/blueprints/who/uml/who_domain_model_import.txt +++ b/docs/blueprints/who/uml/who_domain_model_import.txt @@ -1,111 +1,117 @@ @startuml -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 { -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 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} 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 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 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 WhoFlat { - id: Integer - datum_reported: Date - year: Integer - month: Integer - day_of_month: Integer - day_of_year: Integer - day_of_week: Integer - week_of_year: Integer - year_week: String - day_of_week_str: String - month_str: String - location: String - location_group: String - date_reported: String - country_code: String - country: String - who_region: String - new_cases: String - cumulative_cases: String - new_deaths: String - cumulative_deaths: String - {classifier} import_file_flat() - {classifier} get_years(): Integer[] - {classifier} get_days(): Date[] - {classifier} get_days_for_year(year: Integer): Date[] - {classifier} get_location_groups(): String[] - {classifier} get_locations_for_location_group(location_group: String): String[] - {classifier} get_data_for_location(location: String): WhoFlat[] - {classifier} get_data_for_day(datum_reported: Date): WhoFlat[] -} +package covid19.blueprints.who { + + 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} 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 <|-- DataImport AllImportIncrement <|-- DataImport DataImport <|-- AllFlat diff --git a/docs/blueprints/who/uml/who_domain_model_star_schema.txt b/docs/blueprints/who/uml/who_domain_model_star_schema.txt new file mode 100644 index 0000000000000000000000000000000000000000..5e9c82df42611b17180cbbc1d3f20ef19ab1a622 --- /dev/null +++ b/docs/blueprints/who/uml/who_domain_model_star_schema.txt @@ -0,0 +1,292 @@ +@startuml +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.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) + } + 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[] + } + class WhoService << (S,red) Service >> { + database_drop_create_pretask() + database_drop_create_posttask() + download_files() + import_files() + update_star_schema() + full_update_star_schema() + } + class WhoServiceImport << (S,red) Service >> { + import_file() + } + class WhoServiceUpdateBase << (S,red) Service >> { + } + class WhoServiceUpdateFull << (S,red) Service >> { + -full_update_date_reported() + -full_update_region() + -full_update_country() + -full_update_data() + full_update_dimension_tables() + full_update_fact_table() + full_update_star_schema() + } + class WhoServiceUpdate << (S,red) Service >> { + -update_date_reported() + -update_region() + -update_country() + -update_data() + update_dimension_tables() + update_fact_table() + update_star_schema() + -who_import_get_new_dates_as_array() + } + class who_views_frontend << (B,orchid) Boundary >> { + url_root() + url_home() + url_update_data() + url_rename() + url_kurse_all() + url_kurse_workflow_lektionen(workflow_id: Integer) + url_kurse_workflow_lektion_folien(lektion_id: Integer) + url_abbbildung_id(abbildung_id: Integer) + url_db_dump() + url_db_reimport() + task_data_update() + task_rename_src_files() + } + class who_celery_tasks << (B,orchid) Boundary >> { + url_root() + url_home() + url_update_data() + url_rename() + url_kurse_all() + url_kurse_workflow_lektionen(workflow_id: Integer) + url_kurse_workflow_lektion_folien(lektion_id: Integer) + url_abbbildung_id(abbildung_id: Integer) + url_db_dump() + url_db_reimport() + task_data_update() + task_rename_src_files() + } + class who_views_for_tasks << (B,orchid) Boundary >> { + url_root() + url_home() + url_update_data() + url_rename() + url_kurse_all() + url_kurse_workflow_lektionen(workflow_id: Integer) + url_kurse_workflow_lektion_folien(lektion_id: Integer) + url_abbbildung_id(abbildung_id: Integer) + url_db_dump() + url_db_reimport() + task_data_update() + task_rename_src_files() + } +} +WhoServiceImport : SQLAlchemy database +WhoServiceUpdateBase : SQLAlchemy database +WhoServiceUpdateFull <|-- WhoServiceUpdateBase +WhoServiceUpdate <|-- WhoServiceUpdateBase +WhoService : SQLAlchemy database +ApplicationServiceDownload : SQLAlchemy database +ApplicationDateReported <|-- WhoDateReported +ApplicationRegion <|-- WhoCountryRegion +WhoCountry "1" *--> "*" WhoCountryRegion : region +WhoData "1" *--> "*" WhoCountry : country +WhoData "1" *--> "*" WhoDateReported : date_reported +WhoService "*" *--> "1" ApplicationServiceConfig : cfg +WhoServiceImport "*" --> "1" ApplicationServiceConfig : cfg +WhoServiceUpdate "*" --> "1" ApplicationServiceConfig : cfg +WhoServiceUpdateFull "*" --> "1" ApplicationServiceConfig : cfg +ApplicationServiceDownload "*" --> "1" ApplicationServiceConfig : cfg +WhoService "1" *--> "1" WhoServiceImport : service_import +WhoService "1" *--> "1" WhoServiceUpdate : service_update +WhoService "1" *--> "1" WhoServiceUpdateFull : service_update_full +WhoService "1" *--> "1" ApplicationServiceDownload : service_download +who_views_frontend "1" --> "1" WhoService : who_service +who_views_for_tasks "1" --> "1" WhoService : who_service +who_celery_tasks "1" --> "1" WhoService : who_service +@enduml