Merged PR 2199: Computes (paid) guest revenue metric

Adds the following metrics:

- Guest Revenue
by both visions (global and by deal id)

It creates 2 new models:
- int_core__mtd_guest_revenue_metrics
- int_core__monthly_guest_revenue_history_by_deal

the approaches are similar in the sense that we retrieve the information from the int_core__verification_payments and a filter by a PAID status. I checked and the aggregated volumes of the figures correspond to the decimal as what is reported to the guest_payments dashboard (aggregating the information from the currency tab)

Same as last PR, this one does not exposes the data since a refactor of how the code is structured will follow shortly.

Related work items: #18107
This commit is contained in:
Oriol Roqué Paniagua 2024-07-05 15:01:21 +00:00
parent 2efc1d8b65
commit d1362bb1db
3 changed files with 206 additions and 0 deletions

View file

@ -131,3 +131,41 @@ models:
DWH, this will be the point in time when we made the assumption.
tests:
- not_null
- name: int_mtd_guest_revenue_metrics
description: |
This model contains the historic information regarding the guest revenue in an aggregated manner.
It's used for the business KPIs. Data is aggregated at the last day of the month and in the
days necessary for the Month-to-Date computation of the current month.
columns:
- name: date
data_type: date
description: The date for the month-to-date guest revenue-related metrics.
tests:
- not_null
- unique
- name: int_monthly_guest_revenue_history_by_deal
description: |
This model contains the historic information regarding the guest revenue for each deal id.
It's used for the business KPIs in the view by deal id. Data is aggregated at the last
day of the month, or up to yesterday if it's the current month.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- date
- id_deal
columns:
- name: date
data_type: date
description: The last day of the month or yesterday for historic guest revenue metrics.
tests:
- not_null
- name: id_deal
data_type: character varying
description: Id of the deal associated to the host.
tests:
- not_null