Merged PR 4757: Creates a Total Booking Fees metric (Old dash + New dash)

# Description

Main Changes:
* Computes the total booking fees in `int_kpis__metric_daily_invoiced_revenue`
* Propagates within KPIs, including schema and tests
* Propagates within cross in both "by deal" and "by dimension/global"
* Propagates to main kpis tests

Small fix:
* In `int_mtd_vs_previous_year_metrics`, manual formatting because sqlfmt is broken on this model...

# 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: #28560
This commit is contained in:
Oriol Roqué Paniagua 2025-03-20 13:45:44 +00:00
parent 93b31854f7
commit 098ab51439
12 changed files with 101 additions and 8 deletions

View file

@ -36,6 +36,7 @@
sum(
xero_old_dashboard_booking_net_fees_in_gbp
) as xero_old_dashboard_booking_net_fees_in_gbp,
sum(xero_booking_net_fees_in_gbp) as xero_booking_net_fees_in_gbp,
sum(xero_listing_net_fees_in_gbp) as xero_listing_net_fees_in_gbp,
sum(xero_verification_net_fees_in_gbp) as xero_verification_net_fees_in_gbp,
sum(xero_operator_net_fees_in_gbp) as xero_operator_net_fees_in_gbp,

View file

@ -36,6 +36,7 @@
sum(
xero_old_dashboard_booking_net_fees_in_gbp
) as xero_old_dashboard_booking_net_fees_in_gbp,
sum(xero_booking_net_fees_in_gbp) as xero_booking_net_fees_in_gbp,
sum(xero_listing_net_fees_in_gbp) as xero_listing_net_fees_in_gbp,
sum(xero_verification_net_fees_in_gbp) as xero_verification_net_fees_in_gbp,
sum(xero_operator_net_fees_in_gbp) as xero_operator_net_fees_in_gbp,

View file

@ -101,6 +101,26 @@ select
else 0
end
) as xero_old_dashboard_booking_net_fees_in_gbp,
sum(
case
when
-- Computes total bookings fees from both Old Dash and New Dash
-- This needs to be properly handled in the aggregation logic once
-- the alignment with Finance is done.
ixsdm.accounting_root_aggregation in (
'Old Dashboard Booking Fees',
'Basic Protection',
'Protection Plus',
'Protection Pro',
'Basic Screening',
'Screening Plus',
'Id Verification',
'Sex Offenders Check'
)
then ixsdm.line_amount_wo_taxes_in_gbp
else 0
end
) as xero_booking_net_fees_in_gbp,
sum(
case
when ixsdm.accounting_root_aggregation = 'Listing Fees'
@ -118,7 +138,6 @@ select
sum(
case
when
-- New Dash
ixsdm.accounting_kpis_aggregation = 'Invoiced Operator Revenue'
-- Prior to 1st January 2023 we didn't have the split of Booking
-- Fees, Listing Fees and Verification Fees. Everything is

View file

@ -41,6 +41,7 @@ select
sum(
ir.xero_old_dashboard_booking_net_fees_in_gbp
) as xero_old_dashboard_booking_net_fees_in_gbp,
sum(ir.xero_booking_net_fees_in_gbp) as xero_booking_net_fees_in_gbp,
sum(ir.xero_listing_net_fees_in_gbp) as xero_listing_net_fees_in_gbp,
sum(ir.xero_verification_net_fees_in_gbp) as xero_verification_net_fees_in_gbp,
sum(ir.xero_operator_net_fees_in_gbp) as xero_operator_net_fees_in_gbp,

View file

@ -41,6 +41,7 @@ select
sum(
ir.xero_old_dashboard_booking_net_fees_in_gbp
) as xero_old_dashboard_booking_net_fees_in_gbp,
sum(ir.xero_booking_net_fees_in_gbp) as xero_booking_net_fees_in_gbp,
sum(ir.xero_listing_net_fees_in_gbp) as xero_listing_net_fees_in_gbp,
sum(ir.xero_verification_net_fees_in_gbp) as xero_verification_net_fees_in_gbp,
sum(ir.xero_operator_net_fees_in_gbp) as xero_operator_net_fees_in_gbp,

View file

@ -4407,6 +4407,13 @@ models:
Sum of daily Old Dashboard Booking Net Fees, in GBP, without taxes
in a given date and per specified dimension.
- name: xero_booking_net_fees_in_gbp
data_type: decimal
description: |
Sum of daily Total Booking Net Fees, in GBP, without taxes
in a given date and per specified dimension. This takes into
account both Old Dashboard and New Dashboard.
- name: xero_listing_net_fees_in_gbp
data_type: decimal
description: |
@ -4609,6 +4616,13 @@ models:
Sum of accumulated Old Dashboard Booking Net Fees, in GBP, without taxes
in a given month and per specified dimension.
- name: xero_booking_net_fees_in_gbp
data_type: decimal
description: |
Sum of accumulated Total Booking Net Fees, in GBP, without taxes
in a given month and per specified dimension. This takes into
account both Old Dashboard and New Dashboard.
- name: xero_listing_net_fees_in_gbp
data_type: decimal
description: |
@ -4804,6 +4818,13 @@ models:
Sum of accumulated Old Dashboard Booking Net Fees, in GBP, without taxes
in a given month up to the given date and per specified dimension.
- name: xero_booking_net_fees_in_gbp
data_type: decimal
description: |
Sum of accumulated Total Booking Net Fees, in GBP, without taxes
in a given month up to the given date and per specified dimension.
This takes into account both Old Dashboard and New Dashboard.
- name: xero_listing_net_fees_in_gbp
data_type: decimal
description: |
@ -4905,6 +4926,7 @@ models:
- xero_protection_pro_net_fees_in_gbp
- xero_basic_screening_net_fees_in_gbp
- xero_old_dashboard_booking_net_fees_in_gbp
- xero_booking_net_fees_in_gbp
- xero_listing_net_fees_in_gbp
- xero_verification_net_fees_in_gbp
- xero_operator_net_fees_in_gbp
@ -4984,6 +5006,13 @@ models:
The monthly Old Dashboard Booking Net Fees, in GBP, without taxes
for a given date, dimension and value.
- name: xero_booking_net_fees_in_gbp
data_type: decimal
description: |
The monthly Total Booking Net Fees, in GBP, without taxes
for a given date, dimension and value.
This takes into account both Old Dashboard and New Dashboard.
- name: xero_listing_net_fees_in_gbp
data_type: decimal
description: |
@ -5082,6 +5111,7 @@ models:
- xero_protection_pro_net_fees_in_gbp
- xero_basic_screening_net_fees_in_gbp
- xero_old_dashboard_booking_net_fees_in_gbp
- xero_booking_net_fees_in_gbp
- xero_listing_net_fees_in_gbp
- xero_verification_net_fees_in_gbp
- xero_operator_net_fees_in_gbp
@ -5162,6 +5192,13 @@ models:
The month-to-date Old Dashboard Booking Net Fees, in GBP, without taxes
for a given date, dimension and value.
- name: xero_booking_net_fees_in_gbp
data_type: decimal
description: |
The month-to-date Total Booking Net Fees, in GBP, without taxes
for a given date, dimension and value.
This takes into account both Old Dashboard and New Dashboard.
- name: xero_listing_net_fees_in_gbp
data_type: decimal
description: |