Merged PR 4107: First version of accounting aggregations

# Description

Creates a seed to define how to aggregate the different revenue/cost sources, at account code level.

This is propagated to the sales denom mart in intermediate.

This is not complete, but should be a good starting point and it enables moving forward with a couple of tickets regarding KPIs revenue refactor and further Finance reporting, by just keeping a single source of truth. It's mostly focusing on the Don't Repeat Yourself

# 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.

First version of accounting aggregations - not complete

Related work items: #26618
This commit is contained in:
Oriol Roqué Paniagua 2025-01-19 12:20:19 +00:00
parent 06bdb81cfe
commit 151bb46182
4 changed files with 154 additions and 3 deletions

View file

@ -174,3 +174,90 @@ seeds:
data_type: numeric
description: |
How much we charge per night in this time range.
- name: stg_seed__accounting_aggregations
description: |
Account codes and their respective aggregations.
config:
column_types:
account_code: varchar(3)
columns:
- name: account_code
data_type: character varying
description: |
The account code for this aggregation. This is the code that is used
in the accounting system.
data_tests:
- not_null
- unique
- dbt_expectations.expect_column_values_to_match_regex:
regex: "^[0-9]{3}$"
- name: root_aggregation
data_type: character varying
description: |
The root aggregation for this account code. This is the main
aggregation that is used to retrieve low-level data.
data_tests:
- not_null
- accepted_values:
values:
- Other Invoiced Revenue
- Verification Fees
- Listing Fees
- Booking Fees
- Athena API
- E-Deposit API
- Guesty Resolutions
- Basic Protection
- Waiver Pro
- Id Verification
- Protection Plus
- Screening Plus
- Sex Offenders Check
- Protection Pro
- Basic Screening
- Damage Host-Waiver Payments
- Damage Waiver Fees
- Deposit Fees
- Check In Cover
- Resolution Process for Protection Services
- Resolution Process for Deposit Management Services
- Basic Waiver
- Waiver Plus
- Basic Damage Deposit
- name: kpis_aggregation
data_type: character varying
description: |
The default macro-aggregation for Invoiced KPIs.
data_tests:
- not_null
- accepted_values:
values:
- Unknown
- Invoiced Operator Revenue
- Invoiced API Revenue
- Damage Host-Waiver Payments
- Accounting Resolutions
- Accounting Guest Revenue
- name: financial_aggregation
data_type: character varying
description: |
The default macro-aggregation for Financial reporting.
data_tests:
- not_null
- accepted_values:
values:
- Unknown
- Guest Screening and Protection
- Mediation and Resolution
- Damage Host-Waiver Payments
- Guest Products
- Deposit Management