lot of things, should have committed way earlier

This commit is contained in:
Pablo Martin 2024-03-13 10:11:46 +01:00
parent 8b2dca174f
commit 89aed285db
8 changed files with 52 additions and 21 deletions

View file

@ -0,0 +1,27 @@
with
int_core__verification_payments as (
select * from {{ ref("int_core__verification_payments") }}
)
select
vp.id_verification_to_payment as id_verification_to_payment,
vp.id_payment as id_payment,
vp.is_refundable as is_refundable,
vp.payment_due_at_utc as payment_due_at_utc,
vp.payment_due_date_utc as payment_due_date_utc,
vp.payment_paid_at_utc as payment_paid_at_utc,
vp.payment_paid_date_utc as payment_paid_date_utc,
vp.payment_reference as payment_reference,
vp.refund_due_at_utc as refund_due_at_utc,
vp.refund_due_date_utc as refund_due_date_utc,
vp.payment_refunded_at_utc as payment_refunded_at_utc,
vp.payment_refunded_date_utc as payment_refunded_date_utc,
vp.refund_payment_reference as refund_payment_reference,
vp.id_guest_user as id_guest_user,
vp.id_verification as id_verification,
vp.verification_payment_type as verification_payment_type,
vp.amount_in_txn_currency as amount_in_txn_currency,
vp.currency as currency,
vp.amount_in_gbp as amount_in_gbp,
vp.payment_status as payment_status,
vp.notes as notes
from int_core__verification_payments vp

View file

@ -0,0 +1 @@
with dates as (select * from {{ ref("int_dates") }}) select * from dates

View file

@ -1,9 +0,0 @@
with
date_master as (select * from {{ ref("int_dates") }}),
fee_txns as (select * from {{ ref("int_core__guest_fee_txns") }})
select date_master.date_day as date, coalesce(sum(fee_txns.amount), 0)
from date_master
left join fee_txns on date_master.date_day = fee_txns.payment_due_at_utc
where date_day between '2022-01-01' and '2024-12-31'
group by date_master.date_day
order by 2 desc