Commit graph

59 commits

Author SHA1 Message Date
Oriol Roqué Paniagua
20e7220ffe Merged PR 2246: KPIs refactor: naming convention and PBI sources replication
Changing naming to follow convention.
This PR has the following changes:
- the model `int_core__mtd_aggregated_metrics` has been moved to cross and changed the name to `int_mtd_aggregated_metrics`
- the model `int_core__monthly_aggregated_metrics_history_by_deal` has been moved to cross and changed the name to `int_monthly_aggregated_metrics_history_by_deal`
- the reporting models `core__mtd_aggregated_metrics` and `core__monthly_aggregated_metrics_history_by_deal` now source the `int_mtd_aggregated_metrics` and `int_monthly_aggregated_metrics_history_by_deal` to avoid breaking the production dashboard
- the reporting models have been duplicated from core into general with the correct names, i.e., `mtd_aggregated_metrics` and `monthly_aggregated_metrics_history_by_deal`
- Documentation has been moved in intermediate and replicated in reporting, adding comments on the currently in use models that are going to die soon.

This will allow for a transition of the PBI dashboard from one source to another. Exposures file still not touched since technically the report is still sourcing the 'legacy' models. Documentation of the refactor here: https://www.notion.so/knowyourguest-superhog/Refactoring-Business-KPIs-5deb6aadddb34884ae90339402ac16e3

Related work items: #18202
2024-07-09 15:14:50 +00:00
Oriol Roqué Paniagua
409ac47591 Merged PR 2232: KPI refactor - 1st step, bookings
First step on refactor of kpis:
- Remove relative incremental vs. previous year computation from the source model (`mtd_booking_metrics`, in this case)
- Aggregate the source mtd global metrics models into a single model: `int_mtd_vs_previous_year_metrics` (to enable multi-source weighted metric computation) and compute previous year value and relative increment. Now this logic is encapsulated into a macro `calculate_safe_relative_increment`, easing readability and providing a bit more robustness.
- End-to-end continuity to not break the existing dashboard display in `int_core__mtd_aggregated_metrics`

This is a substep of the global change. All info can be found in the documentation [here](https://www.notion.so/knowyourguest-superhog/Refactoring-Business-KPIs-5deb6aadddb34884ae90339402ac16e3)

Related work items: #18202
2024-07-08 15:58:36 +00:00
Oriol Roqué Paniagua
d2b0afdca6 Merged PR 2221: Computes (paid) guest revenue metric - fixed
IMPORTANT: this PR was merged and reverted. The division by 0 error has been fixed in the last commit

Adds the following metrics:
- Guest Revenue

by both visions (global and by deal id)
It creates 2 new models:
- int_mtd_guest_revenue_metrics
- int_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
2024-07-08 11:02:02 +00:00
Oriol Roqué Paniagua
49a3c39b82 Merged PR 2217: Revert '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.

Reverts !2199

Related work items: #18107
2024-07-05 15:19:35 +00:00
Oriol Roqué Paniagua
d1362bb1db 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
2024-07-05 15:01:21 +00:00
Pablo Martin
4c68df570f tests 2024-06-14 16:46:28 +02:00
Pablo Martin
913c07dad6 docs 2024-06-14 16:44:48 +02:00
Pablo Martin
bceb81ea18 more detail in docs 2024-06-14 16:26:18 +02:00
Pablo Martin
eaeb7cb936 schema and tests for new table 2024-06-14 16:26:18 +02:00