Merged PR 4076: CIH fees

# Description

Added booking fees for CIH requests and new model of aggregated monthly fee per user

# 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: #26158
This commit is contained in:
Joaquin Ossa 2025-01-21 09:27:21 +00:00
commit 6141af1eff
5 changed files with 147 additions and 2 deletions

View file

@ -3,11 +3,13 @@
with
stg_core__apim_user as (select * from {{ ref("stg_core__apim_user") }}),
stg_core__apim_user_type as (select * from {{ ref("stg_core__apim_user_type") }}),
stg_core__user as (select * from {{ ref("stg_core__user") }})
stg_core__user as (select * from {{ ref("stg_core__user") }}),
stg_core__currency as (select * from {{ ref("stg_core__currency") }})
select
au.id_apim_user,
au.id_apim_user_type,
u.id_account_currency as id_currency,
c.iso4217_code as currency_code,
au.json_document_user_data ->> 'DealId' as id_deal,
au.json_document_user_data ->> 'AccountType' as account_type,
au.json_document_user_data ->> 'ClientMarkup' as client_markup,
@ -24,3 +26,4 @@ inner join
on au.id_apim_user_type = aut.id_apim_user_type
and upper(aut.user_type_name) = '{{ api_name }}'
inner join stg_core__user u on au.id_apim_user = u.id_user
inner join stg_core__currency c on u.id_account_currency = c.id_currency

View file

@ -4806,6 +4806,12 @@ models:
to: ref('stg_core__currency')
field: id_currency
- name: currency_code
data_type: character varying
description: Currency ISO 4217 code used by user.
data_tests:
- not_null
- name: id_deal
data_type: text
description: ""