Merged PR 2005: Replace Guest Details in CheckIn Cover models with details coming from User table

Fixes https://guardhog.visualstudio.com/Data/_boards/board/t/Data%20Team/Stories/?workitem=17240

Related work items: #17240
This commit is contained in:
Pablo Martín 2024-06-10 15:30:26 +00:00 committed by Oriol Roqué Paniagua
parent d18b47f597
commit 366aa7d1ac
3 changed files with 19 additions and 4 deletions

View file

@ -9,6 +9,7 @@ with
int_core__check_in_cover_prices as (
select * from {{ ref("int_core__check_in_cover_prices") }}
),
int_core__unified_user as (select * from {{ ref("int_core__unified_user") }}),
check_in_cover_payments as (
select
id_verification_request,
@ -49,10 +50,10 @@ select
vr.callback_url,
vr.redirect_url,
vr.logo,
vr.guest_email,
vr.last_name,
vr.first_name,
vr.guest_phone_number,
gu.email as guest_email,
gu.last_name as last_name,
gu.first_name as first_name,
gu.phone_number as guest_phone_number,
vr.telephone_code,
vr.guest_phone_number_2,
b.check_in_at_utc,
@ -101,6 +102,7 @@ left join
check_in_cover_payments p on vr.id_verification_request = p.id_verification_request
left join
int_core__check_in_cover_prices ccp on p.currency = ccp.local_currency_iso_4217
left join int_core__unified_user gu on gu.id_user = vr.id_user_guest
-- 15 is Check-in cover.
-- Adding this condition results in only keeping guest journeys that offered the
-- check-in cover

View file

@ -133,3 +133,13 @@ models:
tests:
- not_null
- unique
- name: int_core__vr_check_in_cover
columns:
- name: id_verification_request
data_type: character varying
description: The unique ID for the verification request.
tests:
- not_null
- unique

View file

@ -194,6 +194,9 @@ models:
description: |
Unique, incremental, internal ID for the related verification
request.
tests:
- not_null
- unique
- name: uuid_verification_request
data_type: text