2024-08-29 11:09:09 +02:00
|
|
|
version: 2
|
|
|
|
|
|
|
|
|
|
models:
|
|
|
|
|
- name: edeposit__agg_fee_per_user
|
|
|
|
|
description:
|
|
|
|
|
"This table holds detailed data on revenue generated through e-deposit verifications.
|
|
|
|
|
Each record provides insights into booking activities per user, including the number
|
|
|
|
|
of bookings, cancellations, and associated fees within specific months. Each record
|
|
|
|
|
captures data for bookings created in a particular month along with their corresponding
|
|
|
|
|
checkout month, allowing for a comprehensive view of the booking lifecycle and associated
|
|
|
|
|
revenues within those periods."
|
|
|
|
|
tests:
|
|
|
|
|
- dbt_utils.unique_combination_of_columns:
|
|
|
|
|
combination_of_columns:
|
|
|
|
|
- year_month_created
|
|
|
|
|
- year_month_checkout
|
2024-08-29 14:25:00 +02:00
|
|
|
- id_user_partner
|
2024-08-29 11:09:09 +02:00
|
|
|
columns:
|
2024-08-29 14:25:00 +02:00
|
|
|
- name: id_user_partner
|
2024-08-29 11:09:09 +02:00
|
|
|
data_type: text
|
2024-08-29 14:25:00 +02:00
|
|
|
description: "unique id value for user partner"
|
|
|
|
|
test:
|
|
|
|
|
- not_null
|
2024-08-29 11:09:09 +02:00
|
|
|
|
2024-08-29 14:25:00 +02:00
|
|
|
- name: year_month_created
|
2024-08-29 11:09:09 +02:00
|
|
|
data_type: text
|
2024-08-29 14:25:00 +02:00
|
|
|
description: "year and month of created date"
|
|
|
|
|
test:
|
|
|
|
|
- not_null
|
2024-08-29 11:09:09 +02:00
|
|
|
|
2024-08-29 14:25:00 +02:00
|
|
|
- name: year_month_checkout
|
2024-08-29 11:09:09 +02:00
|
|
|
data_type: text
|
2024-08-29 14:25:00 +02:00
|
|
|
description: "year and month of check-out date"
|
|
|
|
|
test:
|
|
|
|
|
- not_null
|
2024-08-29 11:09:09 +02:00
|
|
|
|
|
|
|
|
- name: bookings_per_month
|
|
|
|
|
data_type: bigint
|
|
|
|
|
description: "total number of bookings"
|
|
|
|
|
|
|
|
|
|
- name: cancelled_per_month
|
|
|
|
|
data_type: bigint
|
|
|
|
|
description: "number of cancelled bookings"
|
|
|
|
|
|
|
|
|
|
- name: cancelled_ratio
|
|
|
|
|
data_type: numeric
|
|
|
|
|
description: "ratio of cancelled bookings over total bookings"
|
|
|
|
|
|
2024-08-29 14:25:00 +02:00
|
|
|
- name: is_cancellation_threshold_surpassed
|
|
|
|
|
data_type: boolean
|
|
|
|
|
description: "true if the cancellation ratio is higher than the set threshold"
|
|
|
|
|
tests:
|
|
|
|
|
- not_null
|
|
|
|
|
|
2024-08-29 11:09:09 +02:00
|
|
|
- name: sum_cancelled_fee
|
|
|
|
|
data_type: numeric
|
|
|
|
|
description: "sum of fees charged for cancelled bookings
|
|
|
|
|
(currency-less)"
|
|
|
|
|
|
|
|
|
|
- name: sum_ok_status_fee
|
|
|
|
|
data_type: double precision
|
|
|
|
|
description: |
|
|
|
|
|
"sum of fees charged for bookings with status 'Approved' or 'Flagged'
|
|
|
|
|
(currency-less)"
|
|
|
|
|
|
|
|
|
|
- name: sum_rejected_fee
|
|
|
|
|
data_type: numeric
|
|
|
|
|
description: "sum of fees charged for rejected bookings
|
|
|
|
|
(currency-less)"
|
|
|
|
|
|
|
|
|
|
- name: total_revenue
|
|
|
|
|
data_type: double precision
|
|
|
|
|
description: "total sum of fees charged (currency-less)"
|