diff --git a/models/intermediate/core/int_core__vr_check_in_cover.sql b/models/intermediate/core/int_core__vr_check_in_cover.sql index 8572e42..eda2134 100644 --- a/models/intermediate/core/int_core__vr_check_in_cover.sql +++ b/models/intermediate/core/int_core__vr_check_in_cover.sql @@ -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 diff --git a/models/intermediate/core/schema.yaml b/models/intermediate/core/schema.yaml index 1313a70..8f5b57d 100644 --- a/models/intermediate/core/schema.yaml +++ b/models/intermediate/core/schema.yaml @@ -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 + diff --git a/models/reporting/core/schema.yaml b/models/reporting/core/schema.yaml index d35834f..3658766 100644 --- a/models/reporting/core/schema.yaml +++ b/models/reporting/core/schema.yaml @@ -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