Addressed comments

This commit is contained in:
Joaquin 2025-04-22 15:14:06 +02:00
parent a405affdb4
commit 06031a2e79
2 changed files with 20 additions and 19 deletions

View file

@ -3,13 +3,6 @@
{% set resolutions_credited_account_code = "('316')" %}
{% set resolutions_credited_documents = "('ACCRECCREDIT')" %}
{{
config(
materialized="table",
unique_key=["id_account", "account_code", "account_name", "line_description"],
)
}}
with
int_xero__sales_denom_mart as (
select * from {{ ref("int_xero__sales_denom_mart") }}
@ -22,11 +15,12 @@ with
),
int_xero__contacts as (select * from {{ ref("int_xero__contacts") }})
select
blt.id_line_item,
'bank transaction' as document_class,
blt.id_account,
blt.account_code,
blt.account_name,
blt.line_description,
'BANK_TRANSACTION' as document_type,
bt.transaction_date_utc,
xc.id_deal,
blt.quantity,
@ -47,13 +41,14 @@ inner join
left join int_xero__contacts xc on xc.id_contact = bt.id_contact
union all
select
sdm.id_line_item,
sdm.id_account,
sdm.account_code,
sdm.account_name,
sdm.line_description,
sdm.document_type,
sdm.document_class,
sdm.document_is_effective_at_end_of_month_utc,
xc.id_deal,
sdm.id_deal,
sdm.quantity,
sdm.unit_amount,
sdm.line_amount_local_curr,
@ -64,7 +59,6 @@ select
sdm.tax_amount_in_gbp,
sdm.document_currency_iso_4217
from int_xero__sales_denom_mart sdm
left join int_xero__contacts xc on xc.id_contact = sdm.id_contact
where
sdm.account_name in {{ resolutions_credited_account_code }}
and sdm.document_type in {{ resolutions_credited_documents }}

View file

@ -454,19 +454,26 @@ models:
"Year-to-date (YTD) total of sales amount without taxes (GBP) from the start of the previous fiscal
year up to the same month."
- name: int_xero__resolutions_payments
- name: int_xero__host_resolutions_payments
description: |
This model provides a view of transactions related to resolutions, including details
such as transaction date, associated account, and transaction amount.
Previously, all resolution-related transaction data was stored in the `int_xerp__bank_transactions`
Previously, all resolution-related transaction data was stored in the `int_xero__bank_transactions`
model. However, some resolution transactions have been, and will continue to be, credited through
the standard invoicing process — these are stored in the `int_xerp__sales_denom_mart` model.
the standard invoicing process — these are stored in the `int_xero__sales_denom_mart` model.
This model is built by joining the `int_xerp__bank_transactions` and `int_xerp__sales_denom_mart`
This model is built by joining the `int_xero__bank_transactions` and `int_xero__sales_denom_mart`
models to provide a unified view of resolution transactions.
columns:
- name: id_line_item
data_type: text
description: "Unique identifier of the line item associated with the transaction."
data_tests:
- not_null
- unique
- name: id_account
data_type: text
description: "Unique identifier of the account associated with the transaction."
@ -489,15 +496,15 @@ models:
data_type: text
description: "Description of the transaction line item."
- name: document_type
- name: document_class
data_type: text
description: "The type of document associated with the transaction."
description: "Indicates whether the record belongs in an a credit note or a bank transaction."
data_tests:
- not_null
- accepted_values:
values:
- "ACCRECCREDIT"
- "BANK_TRANSACTION"
- "credit note"
- "bank transaction"
- name: transaction_date_utc
data_type: date