Changed date name to check_in_cover_added_date and included model in reporting

This commit is contained in:
Joaquin Ossa 2024-07-03 17:43:27 +02:00
parent 3ce81dfdd1
commit 6bc26a66ff
4 changed files with 14 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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: ""