changed ok_status_fee_in_gbp and added to description

This commit is contained in:
Joaquin Ossa 2024-09-05 11:26:37 +02:00
parent 126973ce1c
commit 7087e9193c
2 changed files with 8 additions and 11 deletions

View file

@ -1,5 +1,7 @@
{% set cost_per_night = 2 %}
{% set ok_status = "Approved" %}
-- 2GBP/booked night if booking is approved, to be charged on checkout
{% set cost_per_night = 2 %}
-- verifications for bookings of 0 nights length (free verifications)
{% set zero_nights_verifications = (
"1e2_IdjTfE-5-63wsVvsLw",
"1eyQxaOrik-tDDY-50yETw",
@ -75,7 +77,6 @@
"Y8LYI_4QE0W0ShG1jAVaDA",
"ZpbBtHGa2E6JaLgX1LsYLQ",
) %}
-- verifications for bookings of 0 nights length (free verifications)
with
int_edeposit__verifications as (
select * from {{ ref("int_edeposit__verifications") }}
@ -84,12 +85,12 @@ select
v.id_verification,
v.id_booking,
v.is_cancelled,
v.number_nights * {{ cost_per_night }} as total_revenue,
v.number_nights * {{ cost_per_night }} as ok_status_fee_in_gbp,
v.created_date_utc,
v.checkout_date_utc
from int_edeposit__verifications v
where
v.verification_source = 'Guesty'
and v.verification_status = 'Approved'
v.version = 'V1'
and v.verification_status = '{{ ok_status }}'
and v.id_booking is not null
and v.id_verification not in {{ zero_nights_verifications }}

View file

@ -333,15 +333,11 @@ models:
description: "indicates if the booking has been cancelled or not."
tests:
- not_null
- accepted_values:
values:
- true
- false
- name: total_revenue
- name: ok_status_fee_in_gbp
data_type: integer
description:
"total fee charged on checkout"
"total fee charged on checkout, this is only charged for approved verifications"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between: