Fixed model that wasn't mapping correctly

This commit is contained in:
Joaquin Ossa 2024-09-10 12:09:16 +02:00
parent d5151e2e90
commit 91296fa91c
2 changed files with 5 additions and 4 deletions

View file

@ -56,7 +56,8 @@ with
end as rejected_fee_in_gbp,
to_char(v.checkout_at_utc, 'YYYY-MM') as year_month_checkout
from int_edeposit__verifications v
inner join stg_core__edeposit_user eu on v.id_user_partner = eu.id_user_partner
inner join
stg_core__edeposit_user eu on {{ user_mapping_case }} = eu.id_user_partner
left join
int_daily_currency_exchange_rates cer
on cer.from_currency = eu.currency
@ -66,7 +67,7 @@ with
),
monthly_cancellation_threshold as (
select
id_user_partner,
{{ user_mapping_case }} as id_user_partner,
year_month_checkout,
case
when
@ -75,7 +76,7 @@ with
then true
else false
end as is_cancellation_threshold_surpassed
from edeposit_records
from edeposit_records v
group by id_user_partner, year_month_checkout
)
select

View file

@ -21,7 +21,7 @@ with
stg_core__edeposit_user as (
select
{{ adapter.quote("Id") }} as id,
{{ user_mapping_case }} as id_user_partner,
lower({{ adapter.quote("UserId") }}) as id_user_partner,
-- this shitty thing right here is all because the currency is currently
-- set up as a free text.
-- they expect to fix this on the next update of E-deposit