Merged PR 2599: Added address_validation to int_core__vr_check_in_cover

# Description

Added address_validation to int_core__vr_check_in_cover for check in hero report in PBI

# Checklist

- [x] The edited models and dependants run properly with production data.
- [x] The edited models are sufficiently documented.
- [x] The edited models contain PK tests, and I've ran and passed them.
- [x] I have checked for DRY opportunities with other models and docs.
- [x] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #17069
This commit is contained in:
Joaquin Ossa 2024-08-20 12:06:51 +00:00
commit db9f9a6c25
2 changed files with 267 additions and 3 deletions

View file

@ -22,6 +22,9 @@ with
where where
verification_payment_type = 'CheckInCover' -- 5 is check-in cover verification_payment_type = 'CheckInCover' -- 5 is check-in cover
and payment_status in ('Paid', 'Refunded') and payment_status in ('Paid', 'Refunded')
),
int_core__address_validations as (
select * from {{ ref("int_core__address_validations") }}
) )
select select
vr.id_verification_request, vr.id_verification_request,
@ -43,6 +46,8 @@ select
and vr.is_verification_request_complete and vr.is_verification_request_complete
) as is_awaiting_check_in, ) as is_awaiting_check_in,
p.amount_in_txn_currency is not null as cover_was_purchased, p.amount_in_txn_currency is not null as cover_was_purchased,
av.validation_passed as address_validation_passed,
av.notes as address_validation_notes,
( (
p.amount_in_txn_currency is null and vr.is_verification_request_complete p.amount_in_txn_currency is null and vr.is_verification_request_complete
) as cover_was_rejected, ) as cover_was_rejected,
@ -103,6 +108,9 @@ left join
left join left join
int_core__check_in_cover_prices ccp on p.currency = ccp.local_currency_iso_4217 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 left join int_core__unified_user gu on gu.id_user = vr.id_user_guest
left join
int_core__address_validations av
on av.id_verification_request = vr.id_verification_request
-- 15 is Check-in cover. -- 15 is Check-in cover.
-- Adding this condition results in only keeping guest journeys that offered the -- Adding this condition results in only keeping guest journeys that offered the
-- check-in cover -- check-in cover

View file

@ -140,13 +140,269 @@ models:
- unique - unique
- name: int_core__vr_check_in_cover - name: int_core__vr_check_in_cover
description:
"This tables holds information on verification requests
with Ckeck-in Hero available for the guests."
columns: columns:
- name: id_verification_request - name: id_verification_request
data_type: character varying data_type: bigint
description: The unique ID for the verification request. description:
"Unique, incremental, internal ID for the related verification
request."
tests: tests:
- not_null
- unique - unique
- not_null
- name: uuid_verification_request
data_type: text
description: "uuid for the related verification request"
- name: id_verification_set
data_type: bigint
description: ""
- name: id_superhog_verified_set
data_type: bigint
description: ""
- name: id_payment_validation_set
data_type: bigint
description: ""
- name: id_user_guest
data_type: character varying
description: Unique, incremental, internal ID for the guest user.
- name: id_user_host
data_type: character varying
description: Unique, incremental, internal ID for the host user.
- name: id_booking
data_type: bigint
description: ""
- name: id_accommodation
data_type: bigint
description: "Id of the accommodation or listing."
- name: is_verification_request_complete
data_type: boolean
description:
"True if the verification request is considered
complete, AKA the guest has finished the full guest journey."
- name: is_past_check_in
data_type: boolean
description: ""
- name: is_awaiting_check_in
data_type: boolean
description: ""
- name: cover_was_purchased
data_type: boolean
description:
"Boolean to indicate if the cover was purchased by the guest or not."
- name: address_validation_passed
data_type: boolean
description:
"Boolean to indicate if the validation was approved or not.
In case there was a problem with the validation it will be Null"
- name: address_validation_notes
data_type: character varying
description: "Notes in case there was some problem with the validation."
- name: cover_was_rejected
data_type: boolean
description: ""
- name: verification_url
data_type: character varying
description: ""
- name: callback_url
data_type: character varying
description: ""
- name: redirect_url
data_type: character varying
description: ""
- name: logo
data_type: character varying
description: ""
- name: guest_email
data_type: character varying
description: "The email of the guest"
- name: last_name
data_type: character varying
description: The last name of the guest.
- name: first_name
data_type: character varying
description: The first name of the guest.
- name: guest_phone_number
data_type: character varying
description: The phone number of the guest.
- name: telephone_code
data_type: character varying
description: The telephone code of the guest.
- name: guest_phone_number_2
data_type: character varying
description: ""
- name: check_in_at_utc
data_type: timestamp without time zone
description: ""
- name: check_in_date_utc
data_type: date
description: ""
- name: check_out_at_utc
data_type: timestamp without time zone
description: ""
- name: check_out_date_utc
data_type: date
description: ""
- name: verification_start_at_utc
data_type: timestamp without time zone
description: ""
- name: verification_start_date_utc
data_type: date
description: ""
- name: verification_end_at_utc
data_type: timestamp without time zone
description: ""
- name: verification_end_date_utc
data_type: date
description: ""
- name: link_used_at_utc
data_type: timestamp without time zone
description: ""
- name: link_used_date_utc
data_type: date
description: ""
- name: expire_at_utc
data_type: timestamp without time zone
description: ""
- name: expire_date_utc
data_type: date
description: ""
- name: is_deleted
data_type: boolean
description: ""
- name: redirect_name
data_type: character varying
description: ""
- name: id_one_step_link
data_type: bigint
description: ""
- name: success_message
data_type: character varying
description: ""
- name: summary
data_type: character varying
description: ""
- name: rejection_reason
data_type: character varying
description: ""
- name: has_switched_to_mobile
data_type: boolean
description: ""
- name: is_verifier_rejected
data_type: boolean
description: ""
- name: config
data_type: character varying
description: ""
- name: metadata
data_type: character varying
description: ""
- name: created_at_utc
data_type: timestamp without time zone
description: "Date and time at which the validation was created."
- name: created_date_utc
data_type: date
description: ""
- name: updated_at_utc
data_type: timestamp without time zone
description: "Date and time at which the validation was last updated."
- name: updated_date_utc
data_type: date
description: ""
- name: dwh_extracted_at_utc
data_type: timestamp with time zone
description: "Date and time at which the record was extracted from the backend into the DWH."
- name: amount_in_txn_currency
data_type: numeric
description:
"The payment amount in the currency in which the transaction actually happened.
If the guest paid in Australian Dollars, this is measured in AUD."
- name: currency
data_type: text
description:
"The currency in which the transaction actually happened."
- name: amount_in_gbp
data_type: numeric
description:
"The payment amount value, converted to GBP, using the exchange rate for
the day on which the payment happened."
- name: payment_status
data_type: character varying
description:
"The status of the payment. It can be one of: Paid, Refunded, Refund Failed."
- name: payment_paid_date_utc
data_type: date
description: ""
- name: checkin_cover_limit_amount_local_curr
data_type: numeric
description:
"The amount for which the guest user is covered if he faces problems
during check-in in their local currency."
- name: checkin_cover_limit_amount_in_gbp
data_type: numeric
description:
"The amount for which the guest user is covered if he faces problems
during check-in in GBP."
- name: int_core__monthly_accommodation_history_by_deal - name: int_core__monthly_accommodation_history_by_deal
description: | description: |