From 929628bc7cd4adcdd76f2123b3c82f667c8e472d Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 4 Jun 2024 14:42:50 +0200 Subject: [PATCH 1/5] add integration to sources --- models/staging/core/_core_sources.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/staging/core/_core_sources.yml b/models/staging/core/_core_sources.yml index f680cad..38be2ae 100644 --- a/models/staging/core/_core_sources.yml +++ b/models/staging/core/_core_sources.yml @@ -201,4 +201,6 @@ sources: identifier: PricePlanChargedByType - name: Currency identifier: Currency + - name: Integration + identifier: Integration From a312b1730b1823bff177a005fb91f64c9dc95516 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 4 Jun 2024 14:51:03 +0200 Subject: [PATCH 2/5] staging model for integration table --- models/staging/core/stg_core__integration.sql | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 models/staging/core/stg_core__integration.sql diff --git a/models/staging/core/stg_core__integration.sql b/models/staging/core/stg_core__integration.sql new file mode 100644 index 0000000..3b43747 --- /dev/null +++ b/models/staging/core/stg_core__integration.sql @@ -0,0 +1,24 @@ +with + raw_integration as (select * from {{ source("core", "Integration") }}), + stg_core__integration as ( + select + {{ adapter.quote("Id") }} as id_integration, + {{ adapter.quote("Identifier") }} as uuid_integration, + {{ adapter.quote("SuperhogUserId") }} as id_superhog_user, + {{ adapter.quote("IntegrationTypeId") }} id_integration_type, + {{ adapter.quote("IsActive") }} as is_active, + {{ adapter.quote("LoggingIsActive") }} as is_logging_active, + {{ adapter.quote("IsStayImportingEnabled") }} as is_stay_importing_enabled, + {{ adapter.quote("IgnoreStaysOnFirstImport") }} + as ignore_stays_on_first_import, + {{ adapter.quote("CreatedByCutOffDate") }} as cutoff_date, + {{ adapter.quote("AuthenticationConfiguration") }} authentication_configuration, + {{ adapter.quote("CreatedDate") }} as created_at_utc, + {{ adapter.quote("UpdatedDate") }} as updated_at_utc, + {{ adapter.quote("DateDeleted") }} as deleted_at_utc, + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc + + from raw_integration + ) +select * +from stg_core__integration From 8ec14a14c19cdd99c109e673e7966a9d8cffd3c9 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 4 Jun 2024 14:58:16 +0200 Subject: [PATCH 3/5] add integration type to sources --- models/staging/core/_core_sources.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/staging/core/_core_sources.yml b/models/staging/core/_core_sources.yml index 38be2ae..12ae258 100644 --- a/models/staging/core/_core_sources.yml +++ b/models/staging/core/_core_sources.yml @@ -203,4 +203,5 @@ sources: identifier: Currency - name: Integration identifier: Integration - + - name: IntegrationType + identifier: IntegrationType From f5ae39e44317443efa8ad9dad4199641553f6d3b Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 4 Jun 2024 15:05:26 +0200 Subject: [PATCH 4/5] add integration type model --- .../core/stg_core__integration_type.sql | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 models/staging/core/stg_core__integration_type.sql diff --git a/models/staging/core/stg_core__integration_type.sql b/models/staging/core/stg_core__integration_type.sql new file mode 100644 index 0000000..0296a79 --- /dev/null +++ b/models/staging/core/stg_core__integration_type.sql @@ -0,0 +1,24 @@ +with + raw_integration_type as (select * from {{ source("core", "IntegrationType") }}), + stg_core__integration_type as ( + select + {{ adapter.quote("Id") }} as id_integration_type, + {{ adapter.quote("AuthenticationTypeId") }} as id_authentication_type, + {{ adapter.quote("Logo") }} as logo, + {{ adapter.quote("Name") }} as integration_type, + {{ adapter.quote("IsHidden") }} as is_hidden, + {{ adapter.quote("DisplayName") }} as display_name, + {{ adapter.quote("Configuration") }} as integration_type_configuration, + {{ adapter.quote("IsWebhookKygEnabled") }} as is_webhook_kyg_enabled, + {{ adapter.quote("CreatedDateCutOffAllowed") }} + as is_created_date_cutoff_allowed, + {{ adapter.quote("IsWebhookSuperhogEnabled") }} + as is_webhook_superhog_enabled, + {{ adapter.quote("CreatedDate") }} as created_at_utc, + {{ adapter.quote("UpdatedDate") }} as updated_at_utc, + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc + + from raw_integration_type + ) +select * +from stg_core__integration_type From bfd05a6410527056e2e18b76c82e3e1a9bac583f Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 4 Jun 2024 18:21:56 +0200 Subject: [PATCH 5/5] add missing _utc suffix --- models/staging/core/stg_core__integration.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/staging/core/stg_core__integration.sql b/models/staging/core/stg_core__integration.sql index 3b43747..17d5f3e 100644 --- a/models/staging/core/stg_core__integration.sql +++ b/models/staging/core/stg_core__integration.sql @@ -11,7 +11,7 @@ with {{ adapter.quote("IsStayImportingEnabled") }} as is_stay_importing_enabled, {{ adapter.quote("IgnoreStaysOnFirstImport") }} as ignore_stays_on_first_import, - {{ adapter.quote("CreatedByCutOffDate") }} as cutoff_date, + {{ adapter.quote("CreatedByCutOffDate") }} as cutoff_date_utc, {{ adapter.quote("AuthenticationConfiguration") }} authentication_configuration, {{ adapter.quote("CreatedDate") }} as created_at_utc, {{ adapter.quote("UpdatedDate") }} as updated_at_utc,