Simplify PR

This commit is contained in:
Joaquin Ossa 2024-12-20 14:03:58 +01:00
parent 79b408f3d2
commit 19d883ccd7
9 changed files with 52 additions and 209 deletions

View file

@ -2,10 +2,12 @@
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__apim_user_type as (select * from {{ ref("stg_core__apim_user_type") }}),
stg_core__user as (select * from {{ ref("stg_core__user") }})
select
au.id_apim_user,
au.id_apim_user_type,
u.id_account_currency as id_currency,
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,
@ -42,3 +44,4 @@ inner join
stg_core__apim_user_type aut
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

View file

@ -4590,6 +4590,16 @@ models:
data_type: bigint
description: "Identifier of the type of user."
- name: id_currency
data_type: bigint
description: "Id of the currency, works as a foreign key to the
currency table"
tests:
- not_null
- relationships:
to: ref('stg_core__currency')
field: id_currency
- name: id_deal
data_type: text
description: ""