From 0bf8cac41af0fbd701c5fea64bccbf061be3c0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Roqu=C3=A9=20Paniagua?= Date: Fri, 4 Apr 2025 08:40:38 +0000 Subject: [PATCH] Merged PR 4918: Adds Integration Type from Hubspot Deals # Description Extracts Integration Type (OSL, PMS, AutoHost, other API stuff) from Hubspot Deals. This is needed for the categorisation of Deals in the scope of Old Dash to New Dash migration. # Checklist - [X] The edited models and dependants run properly with production data. - [X] The edited models are sufficiently documented. - [X] The edited models contain PK tests, and I've ran and passed them. - [ ] I have checked for DRY opportunities with other models and docs. - [ ] I've picked the right materialization for the affected models. # Other - [ ] Check if a full-refresh is required after this PR is merged. Related work items: #28987 --- models/intermediate/hubspot/int_hubspot__deal.sql | 1 + models/intermediate/hubspot/schema.yml | 6 ++++++ models/staging/hubspot/schema.yml | 6 ++++++ models/staging/hubspot/stg_hubspot__deals.sql | 3 ++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/models/intermediate/hubspot/int_hubspot__deal.sql b/models/intermediate/hubspot/int_hubspot__deal.sql index 73b37be..c89c797 100644 --- a/models/intermediate/hubspot/int_hubspot__deal.sql +++ b/models/intermediate/hubspot/int_hubspot__deal.sql @@ -23,6 +23,7 @@ select d.amount_of_properties, d.last_contacted_date_utc, d.amount_times_contacted, + d.integration_type, d.dashboard_type, d.pricing_structure, d.partnership_services, diff --git a/models/intermediate/hubspot/schema.yml b/models/intermediate/hubspot/schema.yml index 79eff1a..ea598f2 100644 --- a/models/intermediate/hubspot/schema.yml +++ b/models/intermediate/hubspot/schema.yml @@ -80,6 +80,12 @@ models: data_type: integer description: Amount of times the account has been contacted + - name: integration_type + data_type: text + description: | + The type of integration that the customer has, such as OSL, + PMS, etc. It can be null. + - name: dashboard_type data_type: text description: | diff --git a/models/staging/hubspot/schema.yml b/models/staging/hubspot/schema.yml index 6bb76d8..7113122 100644 --- a/models/staging/hubspot/schema.yml +++ b/models/staging/hubspot/schema.yml @@ -376,6 +376,12 @@ models: data_type: jsonb description: "" + - name: integration_type + data_type: text + description: | + The type of integration that the customer has, such as OSL, + PMS, etc. It can be null. + - name: dashboard_type data_type: text description: | diff --git a/models/staging/hubspot/stg_hubspot__deals.sql b/models/staging/hubspot/stg_hubspot__deals.sql index 9de1fb7..fbbee1d 100644 --- a/models/staging/hubspot/stg_hubspot__deals.sql +++ b/models/staging/hubspot/stg_hubspot__deals.sql @@ -75,7 +75,8 @@ with cast( {{ adapter.quote("properties") }} ->> 'free_trial_end_date' as date ) as free_trial_end_date_utc, - + {{ adapter.quote("properties") }} + ->> 'integration_type' as integration_type, {{ adapter.quote("properties") }} ->> 'dashboard' as dashboard_type, {{ adapter.quote("properties") }} ->> 'pricing_structure' as pricing_structure,