From ce2da1b43465d20e788b85955e20d4870a541395 Mon Sep 17 00:00:00 2001 From: "thomas.woehlke" <thomas.woehlke@rub.de> Date: Sun, 14 Mar 2021 21:36:57 +0100 Subject: [PATCH] uml --- docs/Domain_Model.md | 113 ------------- .../rki_vaccination_domain_model.txt | 150 ++++++++++++++++++ 2 files changed, 150 insertions(+), 113 deletions(-) delete mode 100644 docs/Domain_Model.md create mode 100644 docs/blueprints/rki_vaccination/rki_vaccination_domain_model.txt diff --git a/docs/Domain_Model.md b/docs/Domain_Model.md deleted file mode 100644 index 59ca7ab4..00000000 --- a/docs/Domain_Model.md +++ /dev/null @@ -1,113 +0,0 @@ -# Domain Model - -### WHO - -#### who_date_reported -````postgresql -CREATE TABLE public.who_date_reported ( - id integer NOT NULL, - date_reported character varying(255) NOT NULL -); -```` -````python -class WhoDateReported(db.Model): - __tablename__ = 'who_date_reported' - - id = db.Column(db.Integer, primary_key=True) - date_reported = db.Column(db.String(255), unique=True, nullable=False) -```` - -#### who_region -````postgresql -CREATE TABLE public.who_region ( - id integer NOT NULL, - region character varying(255) NOT NULL -); -```` -````python -class WhoRegion(db.Model): - __tablename__ = 'who_region' - - id = db.Column(db.Integer, primary_key=True) - region = db.Column(db.String(255), unique=True, nullable=False) -```` - -#### who_country -````postgresql -CREATE TABLE public.who_country ( - id integer NOT NULL, - country_code character varying(255) NOT NULL, - country character varying(255) NOT NULL, - region_id integer NOT NULL -); -```` -````python -class WhoCountry(db.Model): - __tablename__ = 'who_country' - - id = db.Column(db.Integer, primary_key=True) - country_code = db.Column(db.String(255), unique=True, nullable=False) - country = db.Column(db.String(255), unique=False, nullable=False) - region_id = db.Column(db.Integer, db.ForeignKey('who_region.id'), nullable=False) - region = db.relationship('WhoRegion', lazy='joined') -```` - -#### who_global_data -````postgresql -CREATE TABLE public.who_global_data ( - id integer NOT NULL, - cases_new integer NOT NULL, - cases_cumulative integer NOT NULL, - deaths_new integer NOT NULL, - deaths_cumulative integer NOT NULL, - date_reported_id integer NOT NULL, - country_id integer NOT NULL -); -```` -````python -class WhoData(db.Model): - __tablename__ = 'who_global_data' - - id = db.Column(db.Integer, primary_key=True) - cases_new = db.Column(db.Integer, nullable=False) - cases_cumulative = db.Column(db.Integer, nullable=False) - deaths_new = db.Column(db.Integer, nullable=False) - deaths_cumulative = db.Column(db.Integer, nullable=False) - - date_reported_id = db.Column(db.Integer, db.ForeignKey('who_date_reported.id'), nullable=False) - date_reported = db.relationship('WhoDateReported', lazy='joined') - - country_id = db.Column(db.Integer, db.ForeignKey('who_country.id'), nullable=False) - country = db.relationship('WhoCountry', lazy='joined') -```` - -#### who_global_data_import -````postgresql -CREATE TABLE public.who_global_data_import ( - id integer NOT NULL, - date_reported character varying(255) NOT NULL, - country_code character varying(255) NOT NULL, - country character varying(255) NOT NULL, - who_region character varying(255) NOT NULL, - new_cases character varying(255) NOT NULL, - cumulative_cases character varying(255) NOT NULL, - new_deaths character varying(255) NOT NULL, - cumulative_deaths character varying(255) NOT NULL, - row_imported boolean NOT NULL -); -```` -````python -class OwidImport(db.Model): - __tablename__ = 'who_global_data_import' - - id = db.Column(db.Integer, primary_key=True) - date_reported = db.Column(db.String(255), nullable=False) - country_code = db.Column(db.String(255), nullable=False) - country = db.Column(db.String(255), nullable=False) - who_region = db.Column(db.String(255), nullable=False) - new_cases = db.Column(db.String(255), nullable=False) - cumulative_cases = db.Column(db.String(255), nullable=False) - new_deaths = db.Column(db.String(255), nullable=False) - cumulative_deaths = db.Column(db.String(255), nullable=False) - row_imported = db.Column(db.Boolean, nullable=False) -```` diff --git a/docs/blueprints/rki_vaccination/rki_vaccination_domain_model.txt b/docs/blueprints/rki_vaccination/rki_vaccination_domain_model.txt new file mode 100644 index 00000000..b27c8768 --- /dev/null +++ b/docs/blueprints/rki_vaccination/rki_vaccination_domain_model.txt @@ -0,0 +1,150 @@ +@startuml +entity Course { + id: Integer + dateiname: String + parent_dir: String + title: String + path_relative: 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_kurse_all() +} +entity Workflow { + 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 Lektion { + 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 FolienSatz { + 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) +} +entity Folie { + id: Integer + title: String + lektion_nr: Integer + folien_nr_in_lektion: Integer + folien_nr_in_foliensatz: Integer + foliensatz_nr_in_lektion: Integer + {classifier} get_folien_for_foliensatz(lektion: FolienSatz) + {classifier} getFolienKey(lektion_nr: Integer, folien_nr_in_lektion: 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) + {classifier} get_folien_for_lektion(lektion: Lektion) +} +entity Abbildung { + id: Integer + dateiname: String + parent_dir: String + title: String + abbildung_nr_in_lektion: Integer + abbildung_nr_in_foliensatz: Integer + folien_nr_in_lektion: Integer + folien_nr_in_foliensatz: Integer + folien_satz_nr: Integer + lektion_nr: Integer + bildnachweis: 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) +} +Course "1" *--> "*" Workflow: workflows +Workflow "*" --> "1" Course: course +Workflow "1" *--> "*" Lektion: lektionen +Lektion "*" --> "1" Workflow: course_workflow +Lektion "1" o--> "*" Abbildung: abbildungen +Abbildung "*" --> "1" Lektion: lektion +Lektion "1" *--> "*" FolienSatz: foliensaetze +FolienSatz "*" --> "1" Lektion: lektion +FolienSatz "1" *--> "*" Folie: folien +FolienSatz "1" *--> "*" Abbildung: abbildungen +Folie "*" --> "1" FolienSatz: foliensatz +Folie "1" o--> "*" Abbildung: abbildungen +Abbildung "*" --> "1" Folie: folie +Abbildung "*" --> "1" FolienSatz: foliensatz +class ArtefactContentService { + rename_src_files() + prepare_data_update() + run_data_update() + run_db_dump() + run_db_reimport() + parse_file_name(datei: String) + create_or_fetch_folie(file_name_dict, lektion: Lektion) + get_abbbildung_for_id(abbbildung_id: Integer) +} +ArtefactContentService : SQLAlchemy database +ArtefactContentService : String[] courses +ArtefactContentService : String[] workflows +ArtefactContentService : String[] lektionen +ArtefactContentService : String[] course_names +class artefact_content_views { + 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() +} +@enduml -- GitLab