Merged PR 4224: Rework accounting aggregations for Financial Reporting

# Description

This PR reworks the Financial Aggregations based on Nathan's requirements, that can be found in an Excel attached to the board ticket.

Main changes:
- Accounting seed now contains 3 financial aggregations as requested by Finance
- These 3 aggregations are propagated up to reporting. This effectively breaks a WIP report - but it's WIP, not in prod, so it's not a big deal

# 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

- [X] Check if a full-refresh is required after this PR is merged. **Need to create the seed manually**

Related work items: #26618
This commit is contained in:
Oriol Roqué Paniagua 2025-01-30 10:28:49 +00:00
parent 491cf2743e
commit a208541e04
6 changed files with 137 additions and 53 deletions

View file

@ -177,7 +177,7 @@ seeds:
- name: stg_seed__accounting_aggregations
description: |
Account codes and their respective aggregations.
Account codes and their respective aggregations for reporting purposes.
config:
column_types:
account_code: varchar(3)
@ -246,18 +246,76 @@ seeds:
- Accounting Resolutions
- Accounting Guest Revenue
- name: financial_aggregation
- name: financial_l1_aggregation
data_type: character varying
description: |
The default macro-aggregation for Financial reporting.
The Level 1 aggregation for Financial reporting.
data_tests:
- not_null
- accepted_values:
values:
- Unknown
- 01-Guest Screening and Protection
- 02-Deposit Management
- 03-Guest Products
- 04-Mediation and Resolution
- 05-Damage Host-Waiver Payments
- 1-Guest Screening and Protection
- 2-Deposit Management
- 4-Mediation and Resolution
- 3-Guest Products
- 5-Damage Host-Waiver Payments
- name: financial_l2_aggregation
data_type: character varying
description: |
The Level 2 aggregation for Financial reporting.
data_tests:
- not_null
- accepted_values:
values:
- Unknown
- 10-Other Invoiced Revenue
- 21-Deposit Management Services
- 13-Verification Fees
- 12-Listing Fees
- 11-Booking Fees
- 14-Athena API
- 15-E-Deposit API
- 41-Guesty Resolutions
- 31-Check In Cover
- 17-Protection Services
- 16-Screening Services
- 51-Damage Host-Waiver Payments
- name: financial_l3_aggregation
data_type: character varying
description: |
The Level 3 aggregation for Financial reporting.
data_tests:
- not_null
- accepted_values:
values:
- Unknown
- 100-Other Invoiced Revenue
- 210-Damage Waiver Fees
- 211-Deposit Fees
- 131-Verification Fees
- 121-Listing Fees
- 111-BookingFees
- 141-Athena API
- 151-E-Deposit API
- 411-Guesty Resolutions
- 311-Check In Cover
- 171-Basic Protection
- 213-Waiver Pro
- 163-Id Verification
- 172-Protection Plus
- 162-Screening Plus
- 164-Sex Offenders Checks
- 173-Protection Pro
- 161-Basic Screening
- 174-Resolution Process for Protection Services
- 211-Basic Waiver
- 212-Waiver Plus
- 214-Basic Damage Deposit
- 215-Resolution Process for Deposit Management Services
- 511-Damage Host-Waiver Payments