new version and docs
This commit is contained in:
parent
d33e5ff2b2
commit
1a35839deb
2 changed files with 57 additions and 0 deletions
|
|
@ -0,0 +1,39 @@
|
|||
with
|
||||
stg_core__user as (select * from {{ ref("stg_core__user") }}),
|
||||
stg_core__verification_set as (
|
||||
select * from {{ ref("stg_core__verification_set") }}
|
||||
),
|
||||
stg_core__verification_set_to_verification_type as (
|
||||
select * from {{ ref("stg_core__verification_set_to_verification_type") }}
|
||||
),
|
||||
int_core__vr_check_in_cover as (
|
||||
select * from {{ ref("int_core__vr_check_in_cover") }}
|
||||
),
|
||||
hosts_with_check_in_cover as (
|
||||
select distinct vrcih.id_user_host
|
||||
from int_core__vr_check_in_cover vrcih
|
||||
where vrcih.created_at_utc >= current_date - interval '30 days'
|
||||
),
|
||||
check_in_cover_added_date_utc as (
|
||||
select
|
||||
vrcih.id_user_host,
|
||||
min(vrcih.created_at_utc) as check_in_cover_added_date_utc
|
||||
from int_core__vr_check_in_cover vrcih
|
||||
group by 1
|
||||
)
|
||||
select
|
||||
u.id_user as id_user_host,
|
||||
u.id_deal,
|
||||
u.last_name,
|
||||
u.user_name,
|
||||
u.first_name,
|
||||
u.email as host_email,
|
||||
u.phone_number,
|
||||
u.joined_at_utc,
|
||||
u.joined_date_utc,
|
||||
ad.check_in_cover_added_date_utc,
|
||||
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 check_in_cover_added_date_utc ad on ad.id_user_host = u.id_user
|
||||
|
|
@ -821,12 +821,30 @@ models:
|
|||
description: Timestamp of when the accommodation record was extracted from the backend into the DWH.
|
||||
|
||||
- name: int_core__check_in_cover_users
|
||||
latest_version: 1
|
||||
|
||||
description:
|
||||
This model contains information about hosts that offer check in cover.
|
||||
It has basic information on the users like name, phone, email or joined date.
|
||||
|
||||
This model is restricted to active user so it doesn't include historical data
|
||||
like users that had check-in cover but are currently inactive.
|
||||
|
||||
The new candidate version for this model, v2, changes the strategy to
|
||||
define which hosts we consider to offer check in cover. v1 used to look at
|
||||
the verification set configurations and added hosts which had the cover in
|
||||
it. v2 instead simply assumes that hosts that have had Guest Journeys
|
||||
which offer the cover in the last 30 natural days are relevant. This is
|
||||
simpler, but considered good enough. This decision was made as part of the
|
||||
migration to the Guest Products data model, which would have made sticking
|
||||
to the old way extremely complex and error prone.
|
||||
|
||||
versions:
|
||||
- v: 1
|
||||
- v: 2
|
||||
columns:
|
||||
- include: all
|
||||
|
||||
columns:
|
||||
- name: id_user_host
|
||||
data_type: character varying
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue