Adding more maps

This commit is contained in:
Scott Idem
2024-07-31 18:10:59 -04:00
parent d063675736
commit aec9271e07
8 changed files with 443 additions and 211 deletions

View File

@@ -78,64 +78,8 @@ def convert_obj_type(
return mk_resp(data=data, response=commons.response)
# INSERT INTO obj (`id_random`, `external_uid`, `external_id`, `code`, `type_name`, `type_ver_id`, `account_id`, `parent_type`, `parent_id`, `passcode`, `name`, `description`, `status`, `enable`, `enable_on`, `archive_on`, `restricted`, `hide`, `priority`, `sort`, `group`, `data_json`, `cfg_json`, `notes`, `created_on`, `updated_on`)
# SELECT
# `id_random`,
# 'external_person_id' AS `external_uid`,
# `external_id` AS `external_id`,
# NULL AS `code`,
# 'event_person' AS `type_name`,
# `id` AS `type_ver_id`,
# `account_id` AS `account_id`,
# 'event' AS `parent_type`,
# `event_id` AS `parent_id`,
# NULL AS `passcode`,
# NULL AS `name`,
# NULL AS `description`,
# `status` AS `status`,
# `enable` AS `enable`,
# NULL AS `enable_on`,
# NULL AS `archive_on`,
# NULL AS `restricted`,
# `hide` AS `hide`,
# `priority` AS `priority`,
# `sort` AS `sort`,
# `group` AS `group`,
# NULL AS `data_json`,
# NULL AS `cfg_json`,
# `notes` AS `notes`,
# `created_on` AS `created_on`,
# `updated_on` AS `updated_on`
# FROM
# `v_event_person`
# ON DUPLICATE KEY UPDATE
# `id_random` = VALUES(`id_random`),
# `external_uid` = VALUES(`external_uid`),
# `external_id` = VALUES(`external_id`),
# `code` = VALUES(`code`),
# `account_id` = VALUES(`account_id`),
# `parent_type` = VALUES(`parent_type`),
# `parent_id` = VALUES(`parent_id`),
# `passcode` = VALUES(`passcode`),
# `name` = VALUES(`name`),
# `description` = VALUES(`description`),
# `status` = VALUES(`status`),
# `enable` = VALUES(`enable`),
# `enable_on` = VALUES(`enable_on`),
# `archive_on` = VALUES(`archive_on`),
# `restricted` = VALUES(`restricted`),
# `hide` = VALUES(`hide`),
# `priority` = VALUES(`priority`),
# `sort` = VALUES(`sort`),
# `group` = VALUES(`group`),
# `data_json` = VALUES(`data_json`),
# `cfg_json` = VALUES(`cfg_json`),
# `notes` = VALUES(`notes`),
# `created_on` = VALUES(`created_on`),
# `updated_on` = VALUES(`updated_on`);
# This will run the generated SQL statement based on the object type and field map provided.
# Updated 2024-07-31
def handle_convert_obj_type(
obj_type: str,
field_map: Dict[str, str]