dipex 4.5.0__tar.gz → 4.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dipex-4.5.0 → dipex-4.5.2}/PKG-INFO +1 -1
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/date_utils.py +13 -13
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/fix_departments.py +3 -3
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sd_changed_at.py +2 -2
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sd_importer.py +12 -12
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/test_date_utils.py +7 -7
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/test_fix_departments.py +7 -7
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/test_sd_changed_at.py +17 -0
- {dipex-4.5.0 → dipex-4.5.2}/pyproject.toml +1 -1
- {dipex-4.5.0 → dipex-4.5.2}/README.rst +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/exporters/sql_export/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/exporters/sql_export/lc_for_jobs_db.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/exporters/sql_export/lora_cache.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/exporters/sql_export/main.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/exporters/sql_export/sql_export.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/exporters/sql_export/sql_table_defs.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/exporters/sql_export/sql_url.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/exporters/sql_export/trigger.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/exporters/utils/priority_by_class.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/config.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/engagement.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/exceptions.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/main.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/models.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sd_changed_at_redo.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sd_cli.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sd_common.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sd_fixup.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sd_log_analyzer.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sd_logging.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sd_payloads.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sdclient/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sdclient/client.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sdclient/requests.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sdclient/responses.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/skip.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/sync_job_id.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/test_mo_against_sd.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/sdlon/test_sd_connectivity.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/fixtures.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/org_manipulations.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/sdclient/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/sdclient/manual.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/sdclient/test_requests.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/sdclient/test_sdclient.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/test_config.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/test_engagement.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/test_sd_common.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/test_sd_importer.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/test_sd_log_analyzer.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/test_skip.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/SD_Lon/tests/test_sync_job_id.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/config.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/initial.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/initial_classes.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/los_files.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/los_import.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/los_leder.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/los_org.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/los_pers.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/los_stam.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/payloads.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/conftest.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/helpers.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/strategies.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/test_config.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/test_initial.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/test_los_files.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/test_los_import.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/test_los_leder.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/test_los_org.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/test_los_pers.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/test_los_stam.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/test_payloads.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/tests/test_util.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/util.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/aarhus/uuids.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_common.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_exceptions.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_fix_enddate.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_helpers.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_jinja_filters.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_life_cycle.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_logger.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_reader.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_sync.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_template_engine.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_templates.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/ad_writer.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/execute_ad_script.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/import_ad_group_into_mo.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/mo_to_ad_sync.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/payloads.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/read_ad_conf_settings.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/sync_mo_uuid_to_ad.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/test_connectivity.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/mocks.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/name_simulator.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_ad_common.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_ad_fix_enddate.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_ad_jinja_filters.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_ad_life_cycle.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_ad_logger.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_ad_reader.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_ad_sync.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_ad_writer.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_dot_mapping.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_first_included.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_import_ad_group_into_mo.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_location_element.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_mo_data_source.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_mo_to_ad_sync.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_morestsource.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_read_ad_conf_settings.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_recursive_dict_update.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_sync_mo_uuid_to_ad.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_usernames.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_utils.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/user_names.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/username_rules/method_2.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/utils.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/adtreesync/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/adtreesync/config.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/adtreesync/ldap.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/adtreesync/main.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/adtreesync/tests/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/adtreesync/tests/test_main.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/apos_importer.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ballerup/ballerup-amqp.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ballerup/ballerup.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/ballerup/udvalg_import.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/br/303/270ndby/br/303/270ndby.py" +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/calculate_primary/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/calculate_primary/calculate_primary.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/calculate_primary/common.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/calculate_primary/default.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/calculate_primary/opus.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/calculate_primary/sd.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/calculate_primary/tests/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/calculate_primary/tests/test_primary.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/cpr_mapper.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/dar_helper/__init__.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/dar_helper/dar_helper.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/dawa_helper.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/egedal/egedal.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/fkorg_it_systems/import_fkorg_orgunits.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/fkorg_it_systems/test_import_fk_org.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/gir/initial_read/emd_csv.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/gir/initial_read/main.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/gir/initial_read/mo_lora_client.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/gir/initial_read/org_unit_csv.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/hj/303/270rring/hj/303/270rring.py" +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/holstebro/holstebro.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/kle/kle_import_export.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/kle/kle_xlsx.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/n/303/246stved/n/303/246stved.py" +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/opus/clear_and_import_opus.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/opus/opus_diff_import.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/opus/opus_exceptions.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/opus/opus_file_reader.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/opus/opus_helpers.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/opus/opus_reimport_one.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/opus/org_tree_print/main.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/opus/payloads.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/opus/tests/test_opus_diff_import.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/opus/tests/test_opus_file_reader.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/opus/tests/test_opus_helpers.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/related_units/from_adtreesync.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/related_units/import_related_units.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/rundb/db_overview.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/rundb/tests/test_db_overview.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/viborg/udvalg_import.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/viborg/viborg.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/viborg/viborg_uuids.py +0 -0
- {dipex-4.5.0 → dipex-4.5.2}/integrations/viborg/viborg_without_ad.py +0 -0
|
@@ -35,7 +35,7 @@ def format_date(date_time: datetime) -> str:
|
|
|
35
35
|
return date_time.strftime("%Y-%m-%d").zfill(10)
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
def
|
|
38
|
+
def parse_datetime(date_str: str) -> datetime:
|
|
39
39
|
return datetime.strptime(date_str, "%Y-%m-%d")
|
|
40
40
|
|
|
41
41
|
|
|
@@ -71,15 +71,15 @@ def _get_employment_from_date(employment: OrderedDict) -> datetime:
|
|
|
71
71
|
)
|
|
72
72
|
|
|
73
73
|
return max(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
parse_datetime(employment_date),
|
|
75
|
+
parse_datetime(employment_department_date),
|
|
76
|
+
parse_datetime(employment_status_date),
|
|
77
|
+
parse_datetime(profession_date),
|
|
78
|
+
parse_datetime(working_time_date),
|
|
79
79
|
)
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
def
|
|
82
|
+
def get_employment_datetimes(employment: OrderedDict) -> Tuple[datetime, datetime]:
|
|
83
83
|
"""
|
|
84
84
|
Get the "from" and "to" date from the SD employment
|
|
85
85
|
|
|
@@ -93,17 +93,17 @@ def get_employment_dates(employment: OrderedDict) -> Tuple[datetime, datetime]:
|
|
|
93
93
|
status = EmploymentStatus(employment["EmploymentStatus"]["EmploymentStatusCode"])
|
|
94
94
|
|
|
95
95
|
if status in EmploymentStatus.let_go():
|
|
96
|
-
|
|
96
|
+
datetime_from = parse_datetime(employment["EmploymentDate"])
|
|
97
97
|
termination_date = str(
|
|
98
98
|
sd_to_mo_termination_date(employment["EmploymentStatus"]["ActivationDate"])
|
|
99
99
|
)
|
|
100
|
-
|
|
101
|
-
return
|
|
100
|
+
datetime_to = parse_datetime(termination_date)
|
|
101
|
+
return datetime_from, datetime_to
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
datetime_from = _get_employment_from_date(employment)
|
|
104
|
+
datetime_to = parse_datetime(employment["EmploymentStatus"]["DeactivationDate"])
|
|
105
105
|
|
|
106
|
-
return
|
|
106
|
+
return datetime_from, datetime_to
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
# TODO: Create "MoValidity" and "SdValidity" classes based on the RA Models
|
|
@@ -14,7 +14,7 @@ from os2mo_helpers.mora_helpers import MoraHelper
|
|
|
14
14
|
|
|
15
15
|
from .date_utils import (
|
|
16
16
|
datetime_to_sd_date,
|
|
17
|
-
|
|
17
|
+
parse_datetime,
|
|
18
18
|
SD_INFINITY,
|
|
19
19
|
MO_INFINITY,
|
|
20
20
|
format_date,
|
|
@@ -221,14 +221,14 @@ class FixDepartments:
|
|
|
221
221
|
logger.info(msg.format(unit_uuid, validity_date))
|
|
222
222
|
validity = {
|
|
223
223
|
"from_date": validity_date.strftime("%d.%m.%Y"),
|
|
224
|
-
"to_date": datetime_to_sd_date(
|
|
224
|
+
"to_date": datetime_to_sd_date(parse_datetime(SD_INFINITY)),
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
departments = self.get_department(validity, uuid=unit_uuid)
|
|
228
228
|
for department in departments:
|
|
229
229
|
# Get the UUID of the parent unit
|
|
230
230
|
parent_lookup_date = max(
|
|
231
|
-
validity_date
|
|
231
|
+
validity_date, parse_datetime(department["ActivationDate"]).date()
|
|
232
232
|
)
|
|
233
233
|
parent_uuid = self.get_parent(unit_uuid, parent_lookup_date)
|
|
234
234
|
|
|
@@ -686,7 +686,7 @@ class ChangeAtSD:
|
|
|
686
686
|
logger.debug(msg.format(job_id, org_unit, validity))
|
|
687
687
|
too_deep = self.settings.sd_import_too_deep
|
|
688
688
|
# Move users and make associations according to NY logic
|
|
689
|
-
today = datetime.datetime.today()
|
|
689
|
+
today = datetime.datetime.today().date()
|
|
690
690
|
ou_info = self.helper.read_ou(org_unit, use_cache=False)
|
|
691
691
|
if "status" in ou_info:
|
|
692
692
|
# This unit does not exist, read its state in the not-too
|
|
@@ -699,7 +699,7 @@ class ChangeAtSD:
|
|
|
699
699
|
# is eliminated, right now it serves to ensure solely that
|
|
700
700
|
# the SD integration does not crash due to the bad code.
|
|
701
701
|
# The solution will then be to fix all the issues using SDTool.
|
|
702
|
-
logger.warning("Unable to apply NY-logic", org_unit)
|
|
702
|
+
logger.warning("Unable to apply NY-logic on unit %s", org_unit)
|
|
703
703
|
return org_unit
|
|
704
704
|
|
|
705
705
|
if ou_info["org_unit_level"]["user_key"] in too_deep:
|
|
@@ -24,8 +24,8 @@ from .config import get_changed_at_settings
|
|
|
24
24
|
from .config import get_importer_settings
|
|
25
25
|
from .config import ImporterSettings
|
|
26
26
|
from .date_utils import format_date, date_to_datetime
|
|
27
|
-
from .date_utils import
|
|
28
|
-
from .date_utils import
|
|
27
|
+
from .date_utils import get_employment_datetimes
|
|
28
|
+
from .date_utils import parse_datetime
|
|
29
29
|
from .models import JobFunction
|
|
30
30
|
from .sd_common import calc_employment_id
|
|
31
31
|
from .sd_common import EmploymentStatus
|
|
@@ -631,17 +631,17 @@ class SdImport:
|
|
|
631
631
|
emp_dep = employment["EmploymentDepartment"]
|
|
632
632
|
unit = emp_dep["DepartmentUUIDIdentifier"]
|
|
633
633
|
|
|
634
|
-
|
|
634
|
+
datetime_from_engagement, datetime_to = get_employment_datetimes(employment)
|
|
635
635
|
# Use org unit start date if engagement starts *before*
|
|
636
636
|
# the org unit start date
|
|
637
|
-
|
|
637
|
+
org_unit_datetime_from = parse_datetime(
|
|
638
638
|
self.importer.organisation_units[unit].date_from
|
|
639
639
|
)
|
|
640
|
-
|
|
640
|
+
datetime_from = max(datetime_from_engagement, org_unit_datetime_from)
|
|
641
641
|
|
|
642
|
-
date_from_str = format_date(
|
|
643
|
-
date_to_str = format_date(
|
|
644
|
-
if
|
|
642
|
+
date_from_str = format_date(datetime_from)
|
|
643
|
+
date_to_str = format_date(datetime_to)
|
|
644
|
+
if datetime_to == datetime.datetime(9999, 12, 31, 0, 0):
|
|
645
645
|
date_to_str = None
|
|
646
646
|
|
|
647
647
|
sd_employment_id = employment_id["id"]
|
|
@@ -650,7 +650,7 @@ class SdImport:
|
|
|
650
650
|
f"to: {date_to_str}"
|
|
651
651
|
)
|
|
652
652
|
|
|
653
|
-
if
|
|
653
|
+
if datetime_to <= datetime_from:
|
|
654
654
|
logger.warning(f"Skip creating employment for id: {sd_employment_id}")
|
|
655
655
|
continue
|
|
656
656
|
|
|
@@ -700,15 +700,15 @@ class SdImport:
|
|
|
700
700
|
# Add historic dummy engagement if the start date of the engagement
|
|
701
701
|
# is older than the start date of the corresponding org unit
|
|
702
702
|
# (see https://redmine.magenta-aps.dk/issues/51898)
|
|
703
|
-
if
|
|
704
|
-
dummy_eng_date_to =
|
|
703
|
+
if datetime_from_engagement < org_unit_datetime_from:
|
|
704
|
+
dummy_eng_date_to = org_unit_datetime_from - datetime.timedelta(days=1)
|
|
705
705
|
dummy_eng_date_to_str = format_date(dummy_eng_date_to)
|
|
706
706
|
self.importer.add_engagement(
|
|
707
707
|
employee=cpr,
|
|
708
708
|
organisation_unit=self.historic_org_unit_uuid,
|
|
709
709
|
job_function_ref=HISTORIC,
|
|
710
710
|
engagement_type_ref="historisk",
|
|
711
|
-
date_from=format_date(
|
|
711
|
+
date_from=format_date(datetime_from_engagement),
|
|
712
712
|
date_to=dummy_eng_date_to_str,
|
|
713
713
|
)
|
|
714
714
|
|
|
@@ -15,7 +15,7 @@ from sdlon.date_utils import format_date
|
|
|
15
15
|
from sdlon.date_utils import datetime_to_sd_date
|
|
16
16
|
from sdlon.date_utils import gen_cut_dates
|
|
17
17
|
from sdlon.date_utils import gen_date_intervals
|
|
18
|
-
from sdlon.date_utils import
|
|
18
|
+
from sdlon.date_utils import get_employment_datetimes
|
|
19
19
|
from sdlon.date_utils import is_midnight
|
|
20
20
|
from sdlon.date_utils import sd_to_mo_termination_date
|
|
21
21
|
from sdlon.date_utils import to_midnight
|
|
@@ -158,7 +158,7 @@ def test_get_from_date_always_return_date():
|
|
|
158
158
|
def test_get_employment_from_date_when_status_is_leave(
|
|
159
159
|
emp_date,
|
|
160
160
|
act_date,
|
|
161
|
-
|
|
161
|
+
exp_datetime,
|
|
162
162
|
):
|
|
163
163
|
employment = OrderedDict(
|
|
164
164
|
[
|
|
@@ -192,9 +192,9 @@ def test_get_employment_from_date_when_status_is_leave(
|
|
|
192
192
|
]
|
|
193
193
|
)
|
|
194
194
|
|
|
195
|
-
|
|
195
|
+
datetime_from, datetime_to = get_employment_datetimes(employment)
|
|
196
196
|
|
|
197
|
-
assert
|
|
197
|
+
assert datetime_from == exp_datetime
|
|
198
198
|
|
|
199
199
|
|
|
200
200
|
@parameterized.expand(
|
|
@@ -205,7 +205,7 @@ def test_get_employment_from_date_when_status_is_leave(
|
|
|
205
205
|
)
|
|
206
206
|
def test_get_employment_to_date_when_status_is_leave(
|
|
207
207
|
deactivation_date,
|
|
208
|
-
|
|
208
|
+
exp_datetime,
|
|
209
209
|
):
|
|
210
210
|
employment = OrderedDict(
|
|
211
211
|
[
|
|
@@ -239,9 +239,9 @@ def test_get_employment_to_date_when_status_is_leave(
|
|
|
239
239
|
]
|
|
240
240
|
)
|
|
241
241
|
|
|
242
|
-
|
|
242
|
+
datetime_from, datetime_to = get_employment_datetimes(employment)
|
|
243
243
|
|
|
244
|
-
assert
|
|
244
|
+
assert datetime_to == exp_datetime
|
|
245
245
|
|
|
246
246
|
|
|
247
247
|
@parameterized.expand(
|
|
@@ -110,7 +110,7 @@ class TestFixDepartment(TestCase):
|
|
|
110
110
|
instance._create_org_unit_if_missing_in_mo = MagicMock(return_value=False)
|
|
111
111
|
with mock_sd_lookup("GetDepartment20111201", {}, {}):
|
|
112
112
|
instance.fix_department(
|
|
113
|
-
"99999999-9999-9999-9999-999999999999",
|
|
113
|
+
"99999999-9999-9999-9999-999999999999", date(2020, 1, 1)
|
|
114
114
|
)
|
|
115
115
|
instance.helper._mo_post.assert_called_with(
|
|
116
116
|
"details/edit",
|
|
@@ -153,7 +153,7 @@ class TestFixDepartment(TestCase):
|
|
|
153
153
|
]
|
|
154
154
|
}
|
|
155
155
|
with mock_sd_lookup("GetDepartment20111201", dict(), sd_response):
|
|
156
|
-
instance.fix_department("uuid",
|
|
156
|
+
instance.fix_department("uuid", date(2020, 1, 1))
|
|
157
157
|
|
|
158
158
|
call_list = instance.helper._mo_post.mock_calls
|
|
159
159
|
|
|
@@ -203,7 +203,7 @@ class TestFixDepartment(TestCase):
|
|
|
203
203
|
# Act
|
|
204
204
|
with mock_sd_lookup("GetDepartment20111201", dict(), dict()):
|
|
205
205
|
instance.fix_department(
|
|
206
|
-
"99999999-9999-9999-9999-999999999999", datetime.today()
|
|
206
|
+
"99999999-9999-9999-9999-999999999999", datetime.today().date()
|
|
207
207
|
)
|
|
208
208
|
|
|
209
209
|
# Assert
|
|
@@ -230,7 +230,7 @@ class TestFixDepartment(TestCase):
|
|
|
230
230
|
|
|
231
231
|
unit_uuid = "11111111-1111-1111-1111-111111111111"
|
|
232
232
|
parent_uuid = "22222222-2222-2222-2222-222222222222"
|
|
233
|
-
today = datetime.today()
|
|
233
|
+
today = datetime.today().date()
|
|
234
234
|
|
|
235
235
|
instance.get_parent = MagicMock(side_effect=[parent_uuid, None])
|
|
236
236
|
instance.get_department = MagicMock(
|
|
@@ -303,8 +303,8 @@ class TestFixDepartment(TestCase):
|
|
|
303
303
|
|
|
304
304
|
get_parent_calls = instance.get_parent.call_args_list
|
|
305
305
|
assert get_parent_calls == [
|
|
306
|
-
call("11111111-1111-1111-1111-111111111111", today
|
|
307
|
-
call("22222222-2222-2222-2222-222222222222", today
|
|
306
|
+
call("11111111-1111-1111-1111-111111111111", today),
|
|
307
|
+
call("22222222-2222-2222-2222-222222222222", today),
|
|
308
308
|
]
|
|
309
309
|
|
|
310
310
|
def test_fix_department_called_recursively(self):
|
|
@@ -344,7 +344,7 @@ class TestFixDepartment(TestCase):
|
|
|
344
344
|
instance._update_org_unit_for_single_sd_dep_registration = MagicMock()
|
|
345
345
|
|
|
346
346
|
# Act
|
|
347
|
-
instance.fix_department(str(unit_uuid),
|
|
347
|
+
instance.fix_department(str(unit_uuid), date(2020, 1, 1))
|
|
348
348
|
|
|
349
349
|
# Assert
|
|
350
350
|
create_org_unit_calls = instance._create_org_unit_if_missing_in_mo.mock_calls
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import datetime
|
|
1
2
|
import unittest
|
|
2
3
|
import uuid
|
|
3
4
|
from collections import OrderedDict
|
|
@@ -1057,6 +1058,22 @@ class Test_sd_changed_at(unittest.TestCase):
|
|
|
1057
1058
|
self.assertEqual(params["DeactivationDate"], to_date.strftime("%d.%m.%Y"))
|
|
1058
1059
|
self.assertEqual(params["DeactivationTime"], to_date.strftime("%H:%M"))
|
|
1059
1060
|
|
|
1061
|
+
def test_fix_department_called_with_date(self):
|
|
1062
|
+
# Arrange
|
|
1063
|
+
sd_updater = setup_sd_changed_at()
|
|
1064
|
+
fix_date = datetime.datetime.today() + datetime.timedelta(weeks=80)
|
|
1065
|
+
sd_updater.helper.read_ou.return_value = {"status": "found"}
|
|
1066
|
+
|
|
1067
|
+
# Act
|
|
1068
|
+
sd_updater.apply_NY_logic(
|
|
1069
|
+
"00000000-0000-0000-0000-000000000000", "job_id", None, "person_uuid"
|
|
1070
|
+
)
|
|
1071
|
+
|
|
1072
|
+
# Assert
|
|
1073
|
+
sd_updater.fix_departments_mock.fix_department.assert_called_once_with(
|
|
1074
|
+
"00000000-0000-0000-0000-000000000000", fix_date.date()
|
|
1075
|
+
)
|
|
1076
|
+
|
|
1060
1077
|
|
|
1061
1078
|
def test_read_forced_uuid_use_empty_dict():
|
|
1062
1079
|
sd_updater = setup_sd_changed_at({"sd_read_forced_uuids": False})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dipex-4.5.0 → dipex-4.5.2}/integrations/ad_integration/tests/test_import_ad_group_into_mo.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|