guesty_verifications model
This commit is contained in:
parent
4322206091
commit
7036b24847
4 changed files with 17 additions and 8 deletions
|
|
@ -8,18 +8,18 @@ with
|
||||||
select
|
select
|
||||||
v.id_verification,
|
v.id_verification,
|
||||||
v.id_booking,
|
v.id_booking,
|
||||||
|
v.verification_status,
|
||||||
v.is_cancelled,
|
v.is_cancelled,
|
||||||
-- when number_nights = 0 (booking's checkin and checkout are on the same day)
|
-- when number_nights = 0 (booking's checkin and checkout are on the same day)
|
||||||
-- it's charged for just 1 night
|
-- it's charged for just 1 night
|
||||||
case
|
case
|
||||||
when v.number_nights = 0
|
when v.number_nights = 0 and v.verification_status = '{{ ok_status }}'
|
||||||
then {{ cost_per_night }}
|
then {{ cost_per_night }}
|
||||||
else v.number_nights * {{ cost_per_night }}
|
when v.verification_status = '{{ ok_status }}'
|
||||||
|
then v.number_nights * {{ cost_per_night }}
|
||||||
|
else 0
|
||||||
end as ok_status_fee_in_gbp,
|
end as ok_status_fee_in_gbp,
|
||||||
v.created_date_utc,
|
v.created_date_utc,
|
||||||
v.checkout_date_utc
|
v.checkout_date_utc
|
||||||
from int_edeposit__verifications v
|
from int_edeposit__verifications v
|
||||||
where
|
where v.version = 'V1' and v.id_booking is not null
|
||||||
v.version = 'V1'
|
|
||||||
and v.verification_status = '{{ ok_status }}'
|
|
||||||
and v.id_booking is not null
|
|
||||||
|
|
|
||||||
|
|
@ -329,6 +329,10 @@ models:
|
||||||
tests:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
|
- name: verification_status
|
||||||
|
data_type: text
|
||||||
|
description: "status of the verification"
|
||||||
|
|
||||||
- name: is_cancelled
|
- name: is_cancelled
|
||||||
data_type: boolean
|
data_type: boolean
|
||||||
description: "indicates if the booking has been cancelled or not."
|
description: "indicates if the booking has been cancelled or not."
|
||||||
|
|
@ -344,7 +348,7 @@ models:
|
||||||
- dbt_expectations.expect_column_values_to_be_between:
|
- dbt_expectations.expect_column_values_to_be_between:
|
||||||
min_value: 0
|
min_value: 0
|
||||||
strictly: true
|
strictly: true
|
||||||
where: is_cancelled = false
|
where: is_cancelled = false and verification_status = 'Approved'
|
||||||
|
|
||||||
- name: created_date_utc
|
- name: created_date_utc
|
||||||
data_type: date
|
data_type: date
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ with
|
||||||
select
|
select
|
||||||
gv.id_verification as id_verification,
|
gv.id_verification as id_verification,
|
||||||
gv.id_booking as id_booking,
|
gv.id_booking as id_booking,
|
||||||
|
gv.verification_status as verification_status,
|
||||||
gv.is_cancelled as is_cancelled,
|
gv.is_cancelled as is_cancelled,
|
||||||
gv.ok_status_fee_in_gbp as ok_status_fee_in_gbp,
|
gv.ok_status_fee_in_gbp as ok_status_fee_in_gbp,
|
||||||
gv.created_date_utc as created_date_utc,
|
gv.created_date_utc as created_date_utc,
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,10 @@ models:
|
||||||
tests:
|
tests:
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
|
- name: verification_status
|
||||||
|
data_type: text
|
||||||
|
description: "status of the verification"
|
||||||
|
|
||||||
- name: is_cancelled
|
- name: is_cancelled
|
||||||
data_type: boolean
|
data_type: boolean
|
||||||
description: "indicates if the booking has been cancelled or not."
|
description: "indicates if the booking has been cancelled or not."
|
||||||
|
|
@ -136,7 +140,7 @@ models:
|
||||||
- dbt_expectations.expect_column_values_to_be_between:
|
- dbt_expectations.expect_column_values_to_be_between:
|
||||||
min_value: 0
|
min_value: 0
|
||||||
strictly: true
|
strictly: true
|
||||||
where: is_cancelled = false
|
where: is_cancelled = false and verification_status = 'Approved'
|
||||||
|
|
||||||
- name: created_date_utc
|
- name: created_date_utc
|
||||||
data_type: date
|
data_type: date
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue