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:
parent
491cf2743e
commit
a208541e04
6 changed files with 137 additions and 53 deletions
|
|
@ -55,7 +55,9 @@ select
|
||||||
|
|
||||||
aa.root_aggregation as accounting_root_aggregation,
|
aa.root_aggregation as accounting_root_aggregation,
|
||||||
aa.kpis_aggregation as accounting_kpis_aggregation,
|
aa.kpis_aggregation as accounting_kpis_aggregation,
|
||||||
aa.financial_aggregation as accounting_financial_aggregation
|
aa.financial_l1_aggregation as accounting_financial_l1_aggregation,
|
||||||
|
aa.financial_l2_aggregation as accounting_financial_l2_aggregation,
|
||||||
|
aa.financial_l3_aggregation as accounting_financial_l3_aggregation
|
||||||
|
|
||||||
from int_xero__invoice_line_items ili
|
from int_xero__invoice_line_items ili
|
||||||
left join int_xero__invoices i on i.id_invoice = ili.id_invoice
|
left join int_xero__invoices i on i.id_invoice = ili.id_invoice
|
||||||
|
|
@ -111,7 +113,9 @@ select
|
||||||
|
|
||||||
aa.root_aggregation,
|
aa.root_aggregation,
|
||||||
aa.kpis_aggregation,
|
aa.kpis_aggregation,
|
||||||
aa.financial_aggregation
|
aa.financial_l1_aggregation,
|
||||||
|
aa.financial_l2_aggregation,
|
||||||
|
aa.financial_l3_aggregation
|
||||||
|
|
||||||
from int_xero__credit_note_line_items cnli
|
from int_xero__credit_note_line_items cnli
|
||||||
left join int_xero__credit_notes cn on cn.id_credit_note = cnli.id_credit_note
|
left join int_xero__credit_notes cn on cn.id_credit_note = cnli.id_credit_note
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,17 @@ models:
|
||||||
description: |
|
description: |
|
||||||
The default macro-aggregation for Invoiced KPIs.
|
The default macro-aggregation for Invoiced KPIs.
|
||||||
|
|
||||||
- name: accounting_financial_aggregation
|
- name: accounting_financial_l1_aggregation
|
||||||
data_type: character varying
|
data_type: character varying
|
||||||
description: |
|
description: |
|
||||||
The default macro-aggregation for Financial reporting.
|
The Level 1 aggregation for Financial reporting.
|
||||||
|
|
||||||
|
- name: accounting_financial_l2_aggregation
|
||||||
|
data_type: character varying
|
||||||
|
description: |
|
||||||
|
The Level 2 aggregation for Financial reporting.
|
||||||
|
|
||||||
|
- name: accounting_financial_l3_aggregation
|
||||||
|
data_type: character varying
|
||||||
|
description: |
|
||||||
|
The Level 3 aggregation for Financial reporting.
|
||||||
|
|
|
||||||
|
|
@ -1376,10 +1376,20 @@ models:
|
||||||
description: |
|
description: |
|
||||||
The default macro-aggregation for Invoiced KPIs.
|
The default macro-aggregation for Invoiced KPIs.
|
||||||
|
|
||||||
- name: accounting_financial_aggregation
|
- name: accounting_financial_l1_aggregation
|
||||||
data_type: character varying
|
data_type: character varying
|
||||||
description: |
|
description: |
|
||||||
The default macro-aggregation for Financial reporting.
|
The Level 1 aggregation for Financial reporting.
|
||||||
|
|
||||||
|
- name: accounting_financial_l2_aggregation
|
||||||
|
data_type: character varying
|
||||||
|
description: |
|
||||||
|
The Level 2 aggregation for Financial reporting.
|
||||||
|
|
||||||
|
- name: accounting_financial_l3_aggregation
|
||||||
|
data_type: character varying
|
||||||
|
description: |
|
||||||
|
The Level 3 aggregation for Financial reporting.
|
||||||
|
|
||||||
- name: account_code_name
|
- name: account_code_name
|
||||||
data_type: character varying
|
data_type: character varying
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ select
|
||||||
sdm.contact_name as contact_name,
|
sdm.contact_name as contact_name,
|
||||||
sdm.accounting_root_aggregation as accounting_root_aggregation,
|
sdm.accounting_root_aggregation as accounting_root_aggregation,
|
||||||
sdm.accounting_kpis_aggregation as accounting_kpis_aggregation,
|
sdm.accounting_kpis_aggregation as accounting_kpis_aggregation,
|
||||||
sdm.accounting_financial_aggregation as accounting_financial_aggregation,
|
sdm.accounting_financial_l1_aggregation as accounting_financial_l1_aggregation,
|
||||||
|
sdm.accounting_financial_l2_aggregation as accounting_financial_l2_aggregation,
|
||||||
|
sdm.accounting_financial_l3_aggregation as accounting_financial_l3_aggregation,
|
||||||
sdm.account_code || '-' || sdm.account_name as account_code_name
|
sdm.account_code || '-' || sdm.account_name as account_code_name
|
||||||
from int_xero__sales_denom_mart sdm
|
from int_xero__sales_denom_mart sdm
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ seeds:
|
||||||
|
|
||||||
- name: stg_seed__accounting_aggregations
|
- name: stg_seed__accounting_aggregations
|
||||||
description: |
|
description: |
|
||||||
Account codes and their respective aggregations.
|
Account codes and their respective aggregations for reporting purposes.
|
||||||
config:
|
config:
|
||||||
column_types:
|
column_types:
|
||||||
account_code: varchar(3)
|
account_code: varchar(3)
|
||||||
|
|
@ -246,18 +246,76 @@ seeds:
|
||||||
- Accounting Resolutions
|
- Accounting Resolutions
|
||||||
- Accounting Guest Revenue
|
- Accounting Guest Revenue
|
||||||
|
|
||||||
- name: financial_aggregation
|
- name: financial_l1_aggregation
|
||||||
data_type: character varying
|
data_type: character varying
|
||||||
description: |
|
description: |
|
||||||
The default macro-aggregation for Financial reporting.
|
The Level 1 aggregation for Financial reporting.
|
||||||
|
|
||||||
data_tests:
|
data_tests:
|
||||||
- not_null
|
- not_null
|
||||||
- accepted_values:
|
- accepted_values:
|
||||||
values:
|
values:
|
||||||
- Unknown
|
- Unknown
|
||||||
- 01-Guest Screening and Protection
|
- 1-Guest Screening and Protection
|
||||||
- 02-Deposit Management
|
- 2-Deposit Management
|
||||||
- 03-Guest Products
|
- 4-Mediation and Resolution
|
||||||
- 04-Mediation and Resolution
|
- 3-Guest Products
|
||||||
- 05-Damage Host-Waiver Payments
|
- 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
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,38 @@
|
||||||
account_code,root_aggregation,kpis_aggregation,financial_aggregation
|
account_code,root_aggregation,kpis_aggregation,financial_l1_aggregation,financial_l2_aggregation,financial_l3_aggregation
|
||||||
"200",Other Invoiced Revenue,Unknown,01-Guest Screening and Protection
|
"200",Other Invoiced Revenue,Unknown,1-Guest Screening and Protection,10-Other Invoiced Revenue,100-Other Invoiced Revenue
|
||||||
"201",Damage Waiver Fees,Accounting Guest Revenue,02-Deposit Management
|
"201",Damage Waiver Fees,Accounting Guest Revenue,2-Deposit Management,21-Deposit Management Services,210-Damage Waiver Fees
|
||||||
"202",Deposit Fees,Accounting Guest Revenue,02-Deposit Management
|
"202",Deposit Fees,Accounting Guest Revenue,2-Deposit Management,21-Deposit Management Services,211-Deposit Fees
|
||||||
"203",Verification Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"203",Verification Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,13-Verification Fees,131-Verification Fees
|
||||||
"204",Listing Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"204",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees
|
||||||
"206",Booking Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"206",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees
|
||||||
"207",Listing Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"207",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees
|
||||||
"208",Booking Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"208",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees
|
||||||
"209",Listing Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"209",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees
|
||||||
"210",Booking Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"210",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees
|
||||||
"211",Listing Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"211",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees
|
||||||
"212",Booking Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"212",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees
|
||||||
"213",Listing Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"213",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees
|
||||||
"214",Booking Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"214",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees
|
||||||
"215",Listing Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"215",Listing Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,12-Listing Fees,121-Listing Fees
|
||||||
"216",Booking Fees,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"216",Booking Fees,Invoiced Operator Revenue,1-Guest Screening and Protection,11-Booking Fees,111-BookingFees
|
||||||
"217",Deposit Fees,Accounting Guest Revenue,02-Deposit Management
|
"217",Deposit Fees,Accounting Guest Revenue,2-Deposit Management,21-Deposit Management Services,211-Deposit Fees
|
||||||
"218",Damage Waiver Fees,Accounting Guest Revenue,02-Deposit Management
|
"218",Damage Waiver Fees,Accounting Guest Revenue,2-Deposit Management,21-Deposit Management Services,210-Damage Waiver Fees
|
||||||
"219",Athena API,Invoiced API Revenue,01-Guest Screening and Protection
|
"219",Athena API,Invoiced API Revenue,1-Guest Screening and Protection,14-Athena API,141-Athena API
|
||||||
"220",E-Deposit API,Invoiced API Revenue,01-Guest Screening and Protection
|
"220",E-Deposit API,Invoiced API Revenue,1-Guest Screening and Protection,15-E-Deposit API,151-E-Deposit API
|
||||||
"221",Guesty Resolutions,Invoiced API Revenue,04-Mediation and Resolution
|
"221",Guesty Resolutions,Invoiced API Revenue,4-Mediation and Resolution,41-Guesty Resolutions,411-Guesty Resolutions
|
||||||
"222",Check In Cover,Accounting Guest Revenue,03-Guest Products
|
"222",Check In Cover,Accounting Guest Revenue,3-Guest Products,31-Check In Cover,311-Check In Cover
|
||||||
"223",Check In Cover,Accounting Guest Revenue,03-Guest Products
|
"223",Check In Cover,Accounting Guest Revenue,3-Guest Products,31-Check In Cover,311-Check In Cover
|
||||||
"227",Basic Protection,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"227",Basic Protection,Invoiced Operator Revenue,1-Guest Screening and Protection,17-Protection Services,171-Basic Protection
|
||||||
"228",Waiver Pro,Invoiced Operator Revenue,02-Deposit Management
|
"228",Waiver Pro,Invoiced Operator Revenue,2-Deposit Management,21-Deposit Management Services,213-Waiver Pro
|
||||||
"229",Id Verification,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"229",Id Verification,Invoiced Operator Revenue,1-Guest Screening and Protection,16-Screening Services,163-Id Verification
|
||||||
"230",Protection Plus,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"230",Protection Plus,Invoiced Operator Revenue,1-Guest Screening and Protection,17-Protection Services,172-Protection Plus
|
||||||
"231",Screening Plus,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"231",Screening Plus,Invoiced Operator Revenue,1-Guest Screening and Protection,16-Screening Services,162-Screening Plus
|
||||||
"232",Sex Offenders Check,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"232",Sex Offenders Check,Invoiced Operator Revenue,1-Guest Screening and Protection,16-Screening Services,164-Sex Offenders Checks
|
||||||
"233",Protection Pro,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"233",Protection Pro,Invoiced Operator Revenue,1-Guest Screening and Protection,17-Protection Services,173-Protection Pro
|
||||||
"234",Basic Screening,Invoiced Operator Revenue,01-Guest Screening and Protection
|
"234",Basic Screening,Invoiced Operator Revenue,1-Guest Screening and Protection,16-Screening Services,161-Basic Screening
|
||||||
"235",Resolution Process for Protection Services,Accounting Resolutions,01-Guest Screening and Protection
|
"235",Resolution Process for Protection Services,Accounting Resolutions,1-Guest Screening and Protection,17-Protection Services,174-Resolution Process for Protection Services
|
||||||
"236",Basic Waiver,Accounting Guest Revenue,02-Deposit Management
|
"236",Basic Waiver,Accounting Guest Revenue,2-Deposit Management,21-Deposit Management Services,211-Basic Waiver
|
||||||
"237",Waiver Plus,Accounting Guest Revenue,02-Deposit Management
|
"237",Waiver Plus,Accounting Guest Revenue,2-Deposit Management,21-Deposit Management Services,212-Waiver Plus
|
||||||
"238",Basic Damage Deposit,Accounting Guest Revenue,02-Deposit Management
|
"238",Basic Damage Deposit,Accounting Guest Revenue,2-Deposit Management,21-Deposit Management Services,214-Basic Damage Deposit
|
||||||
"239",Resolution Process for Deposit Management Services,Accounting Resolutions,02-Deposit Management
|
"239",Resolution Process for Deposit Management Services,Accounting Resolutions,2-Deposit Management,21-Deposit Management Services,215-Resolution Process for Deposit Management Services
|
||||||
"301",Damage Host-Waiver Payments,Damage Host-Waiver Payments,05-Damage Host-Waiver Payments
|
"301",Damage Host-Waiver Payments,Damage Host-Waiver Payments,5-Damage Host-Waiver Payments,51-Damage Host-Waiver Payments,511-Damage Host-Waiver Payments
|
||||||
|
|
|
||||||
|
Loading…
Add table
Add a link
Reference in a new issue