2024-08-27 14:55:29 +02:00
|
|
|
with
|
|
|
|
|
stg_edeposit__verifications as (
|
|
|
|
|
select * from {{ ref("stg_edeposit__verifications") }}
|
|
|
|
|
)
|
|
|
|
|
select
|
2024-08-28 15:00:22 +02:00
|
|
|
-- note that these ids are not the same as the ones found in Core DWH
|
|
|
|
|
-- they are completely unrelated
|
2024-08-29 14:25:00 +02:00
|
|
|
id_verification,
|
2024-08-28 09:58:14 +02:00
|
|
|
id_booking,
|
2024-09-03 17:54:36 +02:00
|
|
|
id_user_partner,
|
|
|
|
|
id_accommodation,
|
|
|
|
|
version,
|
2024-08-28 12:04:05 +02:00
|
|
|
case
|
|
|
|
|
when version = 'V1' then 'Guesty' when version = 'V2' then 'Edeposit' else null
|
|
|
|
|
end as verification_source,
|
2024-08-28 09:58:14 +02:00
|
|
|
verification_status,
|
2024-08-30 10:33:43 +02:00
|
|
|
nightly_fee_local,
|
2024-08-28 09:58:14 +02:00
|
|
|
cast(checkout_at_utc as date) - cast(checkin_at_utc as date) as number_nights,
|
|
|
|
|
email_flag,
|
|
|
|
|
phone_flag,
|
|
|
|
|
watch_list,
|
|
|
|
|
channel,
|
|
|
|
|
checkin_at_utc,
|
2024-08-29 14:25:00 +02:00
|
|
|
cast(checkin_at_utc as date) as checkin_date_utc,
|
2024-08-28 09:58:14 +02:00
|
|
|
checkout_at_utc,
|
2024-08-29 14:25:00 +02:00
|
|
|
cast(checkout_at_utc as date) as checkout_date_utc,
|
2024-08-28 09:58:14 +02:00
|
|
|
is_cancelled,
|
|
|
|
|
cancelled_at_utc,
|
2024-09-02 11:16:51 +02:00
|
|
|
cast(cancelled_at_utc as date) as cancelled_date_utc,
|
2024-08-28 09:58:14 +02:00
|
|
|
user_email,
|
|
|
|
|
guest_email,
|
|
|
|
|
guest_last_name,
|
|
|
|
|
guest_first_name,
|
|
|
|
|
guest_telephone,
|
|
|
|
|
company_name,
|
|
|
|
|
property_manager_name,
|
|
|
|
|
property_manager_email,
|
|
|
|
|
listing_name,
|
|
|
|
|
listing_town,
|
|
|
|
|
listing_country,
|
|
|
|
|
listing_postcode,
|
|
|
|
|
pets_allowed,
|
|
|
|
|
status_updated_at_utc,
|
2024-09-03 18:03:19 +02:00
|
|
|
status_updated_date_utc,
|
2024-08-28 09:58:14 +02:00
|
|
|
updated_at_utc,
|
2024-09-03 18:03:19 +02:00
|
|
|
athena_creation_at_utc,
|
2024-09-04 09:12:21 +02:00
|
|
|
athena_creation_date_utc,
|
2024-09-02 11:16:51 +02:00
|
|
|
created_at_utc,
|
2024-09-03 18:03:19 +02:00
|
|
|
created_date_utc
|
2024-08-28 09:58:14 +02:00
|
|
|
from stg_edeposit__verifications
|