use it in downstream

This commit is contained in:
Pablo Martin 2024-03-08 17:58:14 +01:00
parent 999ae0dd10
commit 1a347c721b

View file

@ -2,15 +2,18 @@ with
stg_core__verification_to_payment as (
select * from {{ ref("stg_core__verification_to_payment") }}
),
stg_core__verification_payment_type as (
select * from {{ ref("stg_core__verification_payment_type") }}
),
monster_payment_join as (
select vtp.*, vpt.*, p.*, ps."Name"
from stg_core__verification_to_payment vtp
left join
sync_core."VerificationPaymentType" vpt
on vtp.id_verification_to_payment = vpt."Id"
stg_core__verification_payment_type vpt
on vtp.id_verification_to_payment = vpt.id_verification_payment_type
left join sync_core."Payment" p on vtp.id_payment = p."PaymentId"
left join sync_core."PaymentStatus" ps on p."PaymentStatusId" = ps."Id"
where vpt."Name" = 'Fee' -- and vtp."VerificationId" = 800000
where vpt.verification_payment_type = 'Fee'
)
select payment_due_at_utc, "Amount" as amount
from monster_payment_join