From 6bc26a66ff62fc52098b692b52e27d63b174808d Mon Sep 17 00:00:00 2001 From: Joaquin Ossa Date: Wed, 3 Jul 2024 17:43:27 +0200 Subject: [PATCH] Changed date name to check_in_cover_added_date and included model in reporting --- .../intermediate/core/int_core__check_in_cover_users.sql | 9 +++++---- models/intermediate/core/schema.yaml | 5 +++-- models/reporting/core/core__check_in_cover_users.sql | 1 + models/reporting/core/schema.yaml | 5 +++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/models/intermediate/core/int_core__check_in_cover_users.sql b/models/intermediate/core/int_core__check_in_cover_users.sql index abcc443..e1d3c52 100644 --- a/models/intermediate/core/int_core__check_in_cover_users.sql +++ b/models/intermediate/core/int_core__check_in_cover_users.sql @@ -16,8 +16,9 @@ with -- vs.isactive is to consider the current verification set used by the host -- vstvt.id_verification_type = 15 is the value for check_in_cover verification ), - adoption_date as ( - select vs.id_user_host, min(date(vs.created_at_utc)) as adoption_date + check_in_cover_added_date as ( + select + vs.id_user_host, min(date(vs.created_at_utc)) as check_in_cover_added_date from stg_core__verification_set as vs left join hosts_with_check_in_cover as hcv on vs.id_user_host = hcv.id_user_host left join @@ -37,9 +38,9 @@ select u.phone_number, u.joined_at_utc, u.joined_date_utc, - ad.adoption_date, + ad.check_in_cover_added_date, u.billing_town, u.company_name from stg_core__user u inner join hosts_with_check_in_cover hcih on hcih.id_user_host = u.id_user -left join adoption_date ad on ad.id_user_host = u.id_user +left join check_in_cover_added_date ad on ad.id_user_host = u.id_user diff --git a/models/intermediate/core/schema.yaml b/models/intermediate/core/schema.yaml index f6ec6b1..a2e95c0 100644 --- a/models/intermediate/core/schema.yaml +++ b/models/intermediate/core/schema.yaml @@ -970,9 +970,10 @@ models: data_type: date description: Date the user joined - - name: adoption_date + - name: check_in_cover_added_date data_type: date - description: Date the user adopted check-in cover + description: + Date the user first included check-in cover - name: billing_town data_type: character varying diff --git a/models/reporting/core/core__check_in_cover_users.sql b/models/reporting/core/core__check_in_cover_users.sql index 053961e..74af5e6 100644 --- a/models/reporting/core/core__check_in_cover_users.sql +++ b/models/reporting/core/core__check_in_cover_users.sql @@ -13,6 +13,7 @@ select phone_number as phone_number, joined_at_utc as joined_at_utc, joined_date_utc as joined_date_utc, + check_in_cover_added_date as check_in_cover_added_date, billing_town as billing_town, company_name as company_name from int_core__check_in_cover_users diff --git a/models/reporting/core/schema.yaml b/models/reporting/core/schema.yaml index 1a3e670..271fa28 100644 --- a/models/reporting/core/schema.yaml +++ b/models/reporting/core/schema.yaml @@ -924,6 +924,11 @@ models: data_type: date description: Date the user joined + - name: check_in_cover_added_date + data_type: date + description: + Date the user first included check-in cover + - name: billing_town data_type: character varying description: ""