Merged PR 2580: Guest Payments metrics per customer segmentation

# Description

Modifies `int_core__mtd_guest_payments_metrics` to include the customer segmentation based on listings. `schema.yaml` is also affected including new fields, tests and apply the proper naming (from guest revenue to guest payments). I also modified a silly naming that was referring to deals to refer to listings/accommodations, my bad.
Added the macro to retrieve the production dimension in `int_core__mtd_vs_previous_year_metrics` to avoid propagating this upwards and messing up with the data display.

Overall, follows a similar strategy as we did for Booking, Guest Journey, Deal and Accommodation metrics. For reference, [here's the previous PR on Accommodations](https://guardhog.visualstudio.com/Data/_git/data-dwh-dbt-project/pullrequest/2575?_a=overview).

# Checklist

- [X] The edited models and dependants run properly with production data.
- [X] The edited models are sufficiently documented.
- [X] The edited models contain PK tests, and I've ran and passed them.
- [X] I have checked for DRY opportunities with other models and docs.
- [X] I've picked the right materialization for the affected models.

# Other

- [ ] Check if a full-refresh is required after this PR is merged.

Related work items: #19325
This commit is contained in:
Oriol Roqué Paniagua 2024-08-19 11:45:42 +00:00
parent 997cb85c6c
commit e1d04c2e4e
3 changed files with 99 additions and 42 deletions

View file

@ -307,7 +307,7 @@ models:
columns:
- name: date
data_type: date
description: The date for the month-to-date deal-related metrics.
description: The date for the month-to-date accommodation-related metrics.
tests:
- not_null
@ -363,17 +363,38 @@ models:
- name: int_core__mtd_guest_payments_metrics
description: |
This model contains the historic information regarding the guest revenue in an aggregated manner.
This model contains the historic information regarding the guest payments 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.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- date
- dimension
- dimension_value
columns:
- name: date
data_type: date
description: The date for the month-to-date guest revenue-related metrics.
description: The date for the month-to-date guest payments-related metrics.
tests:
- not_null
- name: dimension
data_type: string
description: The dimension or granularity of the metrics.
tests:
- accepted_values:
values:
- global
- by_number_of_listings
- name: dimension_value
data_type: string
description: The value or segment available for the selected dimension.
tests:
- not_null
- unique
- name: int_core__monthly_guest_payments_history_by_deal
description: |