Removed bookings_id so we have unique values for id_verification_request, added details as to how we classify the hosts

This commit is contained in:
Joaquin Ossa 2024-07-11 16:19:33 +02:00
parent 5efd91dfbb
commit db04615039
2 changed files with 20 additions and 10 deletions

View file

@ -4,18 +4,19 @@ with
select * from {{ ref("stg_core__verification_request") }}
),
booking_source as (
select
select distinct
vr.id_verification_request,
vr.id_user_guest,
vr.created_at_utc,
vr.created_date_utc,
b.id_booking,
case
when b.id_integration is not null
then 'PMS'
when vr.id_one_step_link is not null
then 'OSL'
else 'API or Manual'
else 'API/MANUAL'
-- At this point we can't differentiate between these 2 categories so for
-- now we keep them together
end as source
from stg_core__verification_request vr
left join
@ -27,6 +28,5 @@ select
bs.id_user_guest as id_user_guest,
bs.created_at_utc as created_at_utc,
bs.created_date_utc as created_date_utc,
bs.id_booking as id_booking,
bs.source as source
from booking_source bs

View file

@ -950,6 +950,14 @@ models:
This model contains information on verification requests
and the category type of host that manages the associated
booking.
For PMS we use the id_integration from stg_core__booking,
if it isn't Null then the host is PMS type.
For OSL we use the id_one_step_link from stg_core__verification_request,
similarly if it isn't Null then the host is OSL type.
Finally if both id_integration and id_one_step_link are Null,
then we classify them as API/MANUAL. (At this point we can't
differentiate between these 2 categories so for now we keep
them together)
columns:
- name: id_verification_request
@ -960,6 +968,7 @@ models:
be associated to more than 1 booking
tests:
- not_null
- unique
- name: id_user_guest
data_type: character varying
@ -975,15 +984,16 @@ models:
description:
Date of creation of the verification request
- name: id_booking
data_type: bigint
description:
Id value for the booking
- name: source
data_type: text
description:
Source type of host of the booking, this could be either;
- PMS
- OSL
- API or Manual
- API/MANUAL
tests:
- accepted_values:
values:
- 'PMS'
- 'OSL'
- 'API/MANUAL'