edeposit_agg_fee_per_user to reporting
This commit is contained in:
parent
951bc70123
commit
ad2eb2544c
6 changed files with 309 additions and 230 deletions
47
models/intermediate/edeposit/int_edeposit__verifications.sql
Normal file
47
models/intermediate/edeposit/int_edeposit__verifications.sql
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
with
|
||||
stg_edeposit__verifications as (
|
||||
select * from {{ ref("stg_edeposit__verifications") }}
|
||||
)
|
||||
select
|
||||
-- note that these ids are not the same as the ones found in Core DWH
|
||||
-- they are completely unrelated
|
||||
id as id_verification,
|
||||
id_booking,
|
||||
id_user as id_user_host,
|
||||
id_listing as id_accommodation,
|
||||
version, -- V1 for Guesty and V2 for E-deposit
|
||||
case
|
||||
when version = 'V1' then 'Guesty' when version = 'V2' then 'Edeposit' else null
|
||||
end as verification_source,
|
||||
verification_status,
|
||||
verification_status_reason,
|
||||
nightly_fee_local,
|
||||
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,
|
||||
checkout_at_utc,
|
||||
is_cancelled,
|
||||
cancelled_at_utc,
|
||||
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,
|
||||
level_of_protection_amount,
|
||||
level_of_protection_currency,
|
||||
status_updated_at_utc,
|
||||
updated_at_utc,
|
||||
creation_at_utc,
|
||||
created_at_utc
|
||||
from stg_edeposit__verifications
|
||||
Loading…
Add table
Add a link
Reference in a new issue