From 463f5edfc3f6a1919cb0686fd74a6713a1c01fb7 Mon Sep 17 00:00:00 2001 From: Joaquin Ossa Date: Tue, 12 Nov 2024 16:33:55 +0100 Subject: [PATCH] new dash new data --- .../core/int_core__new_dash_user_overview.sql | 8 +++++++- models/intermediate/core/schema.yml | 13 +++++++++++++ .../reporting/core/core__new_dash_user_overview.sql | 2 ++ models/reporting/core/schema.yml | 13 +++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/models/intermediate/core/int_core__new_dash_user_overview.sql b/models/intermediate/core/int_core__new_dash_user_overview.sql index 51cbe1e..fcf1b23 100644 --- a/models/intermediate/core/int_core__new_dash_user_overview.sql +++ b/models/intermediate/core/int_core__new_dash_user_overview.sql @@ -11,6 +11,7 @@ with int_core__accommodation_to_product_bundle as ( select * from {{ ref("int_core__accommodation_to_product_bundle") }} ), + int_core__new_dash_users as (select * from {{ ref("int_core__new_dash_users") }}), user_aggregation as ( @@ -21,7 +22,9 @@ with uh.company_name, uh.first_name, uh.last_name, + uh.email, uh.account_currency_iso4217 as account_currency, + ndu.user_in_new_dash_since_date_utc, count(distinct upb.id_user_product_bundle) as total_user_product_bundles, count( distinct case @@ -64,6 +67,7 @@ with end ) as total_bookings_with_product_bundle_with_paid_service from int_core__user_product_bundle upb + inner join int_core__new_dash_users ndu on upb.id_user_host = ndu.id_user_host inner join int_core__user_host uh on upb.id_user_host = uh.id_user_host left join int_core__booking_to_product_bundle btpb @@ -72,7 +76,7 @@ with left join int_core__accommodation_to_product_bundle atpb on upb.id_user_product_bundle = atpb.id_user_product_bundle - group by 1, 2, 3, 4, 5, 6, 7 + group by 1, 2, 3, 4, 5, 6, 7, 8, 9 ) select @@ -82,7 +86,9 @@ select company_name, first_name, last_name, + email, account_currency, + user_in_new_dash_since_date_utc, total_user_product_bundles, total_active_user_product_bundles, total_listings, diff --git a/models/intermediate/core/schema.yml b/models/intermediate/core/schema.yml index 9e9950c..e255ccc 100644 --- a/models/intermediate/core/schema.yml +++ b/models/intermediate/core/schema.yml @@ -2428,11 +2428,24 @@ models: description: | Information about the host user. + - name: email + data_type: string + description: | + Information about the host user. + - name: account_currency data_type: string description: | Currency associated to the host user. + - name: user_in_new_dash_since_date_utc + data_type: integer + description: | + For users that are in New Dash, the effective date since + these users can be considered in New Dash. It the user + has moved from Old Dash, it will be the new_dash_move_date_utc. + If not, it will correspond to the joined_date_utc. + - name: total_user_product_bundles data_type: integer description: | diff --git a/models/reporting/core/core__new_dash_user_overview.sql b/models/reporting/core/core__new_dash_user_overview.sql index b327bab..432ed7d 100644 --- a/models/reporting/core/core__new_dash_user_overview.sql +++ b/models/reporting/core/core__new_dash_user_overview.sql @@ -9,7 +9,9 @@ select company_name as company_name, first_name as first_name, last_name as last_name, + email as email, account_currency as account_currency, + user_in_new_dash_since_date_utc as user_in_new_dash_since_date_utc, total_user_product_bundles as total_user_product_bundles, total_active_user_product_bundles as total_active_user_product_bundles, total_listings as total_listings, diff --git a/models/reporting/core/schema.yml b/models/reporting/core/schema.yml index f2db7c4..1b5a473 100644 --- a/models/reporting/core/schema.yml +++ b/models/reporting/core/schema.yml @@ -1164,11 +1164,24 @@ models: description: | Information about the host user. + - name: email + data_type: string + description: | + Information about the host user. + - name: account_currency data_type: string description: | Currency associated to the host user. + - name: user_in_new_dash_since_date_utc + data_type: integer + description: | + For users that are in New Dash, the effective date since + these users can be considered in New Dash. It the user + has moved from Old Dash, it will be the new_dash_move_date_utc. + If not, it will correspond to the joined_date_utc. + - name: total_user_product_bundles data_type: integer description: |