Merged PR 2029: Guest Journey - start date based on used link

Added verification estimated started at/date utc.
Ensured continuity for existing reports

I also noticed I missed one propagation of the end date, it's fixed here.

Note: changed the naming from 'start' to 'started' since we already had 'completed' and 'used_link'

Related work items: #17268
This commit is contained in:
Oriol Roqué Paniagua 2024-06-13 14:53:58 +00:00
parent 7914d7d8d7
commit 4f6728003a
4 changed files with 13 additions and 14 deletions

View file

@ -12,7 +12,7 @@ with
when pp.price_plan_charged_by_type = 'CheckInDate' when pp.price_plan_charged_by_type = 'CheckInDate'
then b.check_in_at_utc then b.check_in_at_utc
when pp.price_plan_charged_by_type in ('VerificationStartDate', 'All') when pp.price_plan_charged_by_type in ('VerificationStartDate', 'All')
then vr.verification_start_at_utc then vr.verification_estimated_started_at_utc
end as booking_fee_charge_at_utc end as booking_fee_charge_at_utc
from stg_core__booking b from stg_core__booking b
left join left join
@ -30,7 +30,7 @@ with
then then
coalesce( coalesce(
( (
vr.verification_start_at_utc vr.verification_estimated_started_at_utc
between pp.start_at_utc and pp.end_at_utc between pp.start_at_utc and pp.end_at_utc
), ),
false false

View file

@ -3,7 +3,6 @@ with
stg_core__verification_request as ( stg_core__verification_request as (
select * from {{ ref("stg_core__verification_request") }} select * from {{ ref("stg_core__verification_request") }}
), ),
int_core__unified_user as (select * from {{ ref("int_core__unified_user") }}),
int_core__verification_request_completeness as ( int_core__verification_request_completeness as (
select * from {{ ref("int_core__verification_request_completeness") }} select * from {{ ref("int_core__verification_request_completeness") }}
), ),
@ -29,8 +28,8 @@ select
vr.guest_phone_number, vr.guest_phone_number,
vr.telephone_code, vr.telephone_code,
vr.guest_phone_number_2, vr.guest_phone_number_2,
guest.joined_at_utc as verification_start_at_utc, vr.link_used_at_utc as verification_estimated_started_at_utc,
guest.joined_date_utc as verification_start_date_utc, vr.link_used_date_utc as verification_estimated_started_date_utc,
vrcd.estimated_completed_at_utc as verification_estimated_completed_at_utc, vrcd.estimated_completed_at_utc as verification_estimated_completed_at_utc,
vrcd.estimated_completed_date_utc as verification_estimated_completed_date_utc, vrcd.estimated_completed_date_utc as verification_estimated_completed_date_utc,
vr.link_used_at_utc, vr.link_used_at_utc,
@ -53,9 +52,9 @@ select
vr.updated_date_utc, vr.updated_date_utc,
vr.dwh_extracted_at_utc vr.dwh_extracted_at_utc
from stg_core__verification_request vr from stg_core__verification_request vr
left join int_core__unified_user guest on vr.id_user_guest = guest.id_user
left join left join
int_core__verification_request_completeness completeness int_core__verification_request_completeness completeness
on vr.id_verification_request = completeness.id_verification_request on vr.id_verification_request = completeness.id_verification_request
left join int_core__verification_request_completed_date vrcd left join
on vr.id_verification_request = vrcd.id_verification_request int_core__verification_request_completed_date vrcd
on vr.id_verification_request = vrcd.id_verification_request

View file

@ -60,10 +60,10 @@ select
b.check_in_date_utc, b.check_in_date_utc,
b.check_out_at_utc, b.check_out_at_utc,
b.check_out_date_utc, b.check_out_date_utc,
vr.verification_start_at_utc, vr.verification_estimated_started_at_utc as verification_start_at_utc,
vr.verification_start_date_utc, vr.verification_estimated_started_date_utc as verification_start_date_utc,
vr.verification_end_at_utc, vr.verification_estimated_completed_at_utc as verification_end_at_utc,
vr.verification_end_date_utc, vr.verification_estimated_completed_date_utc as verification_end_date_utc,
vr.link_used_at_utc, vr.link_used_at_utc,
vr.link_used_date_utc, vr.link_used_date_utc,
vr.expire_at_utc, vr.expire_at_utc,

View file

@ -22,8 +22,8 @@ select
guest_phone_number as guest_phone_number, guest_phone_number as guest_phone_number,
telephone_code as telephone_code, telephone_code as telephone_code,
guest_phone_number_2 as guest_phone_number_2, guest_phone_number_2 as guest_phone_number_2,
verification_start_at_utc as verification_start_at_utc, verification_estimated_started_at_utc as verification_start_at_utc,
verification_start_date_utc as verification_start_date_utc, verification_estimated_started_date_utc as verification_start_date_utc,
verification_estimated_completed_at_utc as verification_end_at_utc, verification_estimated_completed_at_utc as verification_end_at_utc,
verification_estimated_completed_date_utc as verification_end_date_utc, verification_estimated_completed_date_utc as verification_end_date_utc,
link_used_at_utc as link_used_at_utc, link_used_at_utc as link_used_at_utc,