edeposit_agg_fee_per_user to reporting

This commit is contained in:
Joaquin Ossa 2024-08-29 11:09:09 +02:00
parent 951bc70123
commit ad2eb2544c
6 changed files with 309 additions and 230 deletions

View file

@ -0,0 +1,16 @@
with
int_edeposit__agg_fee_per_user as (
select * from {{ ref("int_edeposit__agg_fee_per_user") }}
)
select
year_month_created as year_month_created,
year_month_checkout as year_month_checkout,
id_user_host as id_user_host,
bookings_per_month as bookings_per_month,
cancelled_per_month as cancelled_per_month,
cancelled_ratio as cancelled_ratio,
sum_cancelled_fee as sum_cancelled_fee,
sum_ok_status_fee as sum_ok_status_fee,
sum_rejected_fee as sum_rejected_fee,
total_revenue as total_revenue
from int_edeposit__agg_fee_per_user

View file

@ -0,0 +1,61 @@
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
- id_user_host
columns:
- name: year_month_created
data_type: text
description: "first day of month of created date"
- name: year_month_checkout
data_type: text
description: "first day of month of check-out date"
- name: id_user_host
data_type: text
description: "unique id value for user host"
- 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"
- 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)"