Created model int_core__verification_request_booking_source to have easier access to host category type in different models
This commit is contained in:
parent
0c1535b150
commit
5efd91dfbb
2 changed files with 77 additions and 1 deletions
|
|
@ -0,0 +1,32 @@
|
||||||
|
with
|
||||||
|
stg_core__booking as (select * from {{ ref("stg_core__booking") }}),
|
||||||
|
stg_core__verification_request as (
|
||||||
|
select * from {{ ref("stg_core__verification_request") }}
|
||||||
|
),
|
||||||
|
booking_source as (
|
||||||
|
select
|
||||||
|
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'
|
||||||
|
end as source
|
||||||
|
from stg_core__verification_request vr
|
||||||
|
left join
|
||||||
|
stg_core__booking b
|
||||||
|
on b.id_verification_request = vr.id_verification_request
|
||||||
|
)
|
||||||
|
select
|
||||||
|
bs.id_verification_request as id_verification_request,
|
||||||
|
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
|
||||||
|
|
@ -943,3 +943,47 @@ models:
|
||||||
data_type: boolean
|
data_type: boolean
|
||||||
description: |
|
description: |
|
||||||
True if guest payed the fee
|
True if guest payed the fee
|
||||||
|
|
||||||
|
|
||||||
|
- name: int_core__verification_request_booking_source
|
||||||
|
description:
|
||||||
|
This model contains information on verification requests
|
||||||
|
and the category type of host that manages the associated
|
||||||
|
booking.
|
||||||
|
|
||||||
|
columns:
|
||||||
|
- name: id_verification_request
|
||||||
|
data_type: bigint
|
||||||
|
description:
|
||||||
|
Id value for the verification request, there can be more
|
||||||
|
than 1 record for each verification request since they can
|
||||||
|
be associated to more than 1 booking
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
|
||||||
|
- name: id_user_guest
|
||||||
|
data_type: character varying
|
||||||
|
description: Id value for the guest
|
||||||
|
|
||||||
|
- name: created_at_utc
|
||||||
|
data_type: timestamp without time zone
|
||||||
|
description:
|
||||||
|
Date and time of creation of the verification request
|
||||||
|
|
||||||
|
- name: created_date_utc
|
||||||
|
data_type: date
|
||||||
|
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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue