Merged PR 3239: Decommission Verification Payments V1
# Description Decoms verification payments v1 version, and keeps v2 alive. The PBI of Guest Payments (Biz Overview) was already switched to V2 but the exposures was not reflecting it, so I changed this. Then I dropped all v1 models for verification payments and their entries in schema. # Checklist - [X] The edited models and dependants run properly with production data. I did run the upstream dependencies on V2 and I don't see orphans in my dbt docs. However I did not fully run end-to-end all models up to PBI reports since there's other sources involved (Xero, etc). - [X] The edited models are sufficiently documented. - [X] The edited models contain PK tests, and I've ran and passed them. - [NA] I have checked for DRY opportunities with other models and docs. - [NA] 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: #22611
This commit is contained in:
parent
b9ca7c5e8c
commit
5735251c67
5 changed files with 1 additions and 97 deletions
|
|
@ -1,59 +0,0 @@
|
|||
{{ config(materialized="table") }}
|
||||
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") }}
|
||||
),
|
||||
stg_core__verification as (select * from {{ ref("stg_core__verification") }}),
|
||||
stg_core__verification_request as (
|
||||
select * from {{ ref("stg_core__verification_request") }}
|
||||
),
|
||||
stg_core__payment as (select * from {{ ref("stg_core__payment") }}),
|
||||
stg_core__payment_status as (select * from {{ ref("stg_core__payment_status") }}),
|
||||
int_simple_exchange_rates as (select * from {{ ref("int_simple_exchange_rates") }})
|
||||
select
|
||||
vtp.id_verification_to_payment,
|
||||
vtp.id_payment,
|
||||
vtp.is_refundable,
|
||||
vtp.created_at_utc,
|
||||
vtp.updated_at_utc,
|
||||
vtp.payment_due_at_utc,
|
||||
vtp.payment_due_date_utc,
|
||||
p.paid_at_utc as payment_paid_at_utc,
|
||||
p.paid_date_utc as payment_paid_date_utc,
|
||||
p.payment_reference,
|
||||
vtp.refund_due_at_utc,
|
||||
vtp.refund_due_date_utc,
|
||||
p.refunded_at_utc as payment_refunded_at_utc,
|
||||
p.refunded_date_utc as payment_refunded_date_utc,
|
||||
p.refund_payment_reference,
|
||||
-- Host User identifier is included to speed up
|
||||
-- KPIs execution, even though the host itself
|
||||
-- has nothing to do with the guest payments.
|
||||
vr.id_user_host,
|
||||
vtp.id_guest_user,
|
||||
vtp.id_verification,
|
||||
v.id_verification_request,
|
||||
vpt.verification_payment_type,
|
||||
p.amount as amount_in_txn_currency,
|
||||
p.currency,
|
||||
(p.amount * r.rate) as amount_in_gbp,
|
||||
ps.payment_status,
|
||||
p.notes
|
||||
from stg_core__verification_to_payment vtp
|
||||
left join stg_core__payment p on vtp.id_payment = p.id_payment
|
||||
left join stg_core__verification v on vtp.id_verification = v.id_verification
|
||||
left join
|
||||
stg_core__verification_payment_type vpt
|
||||
on vtp.id_verification_payment_type = vpt.id_verification_payment_type
|
||||
left join stg_core__payment_status ps on p.id_payment_status = ps.id_payment_status
|
||||
left join
|
||||
int_simple_exchange_rates r
|
||||
on vtp.payment_due_date_utc = r.rate_date_utc
|
||||
and p.currency = r.from_currency
|
||||
and r.to_currency = 'GBP'
|
||||
left join
|
||||
stg_core__verification_request vr
|
||||
on v.id_verification_request = vr.id_verification_request
|
||||
|
|
@ -982,11 +982,6 @@ models:
|
|||
- name: notes
|
||||
data_type: character varying
|
||||
versions:
|
||||
- v: 1
|
||||
deprecation_date: 2024-10-15 00:00:00.00+00:00
|
||||
config:
|
||||
alias: int_core__verification_payments
|
||||
|
||||
- v: 2
|
||||
columns:
|
||||
- name: total_amount_in_txn_currency
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
with
|
||||
int_core__verification_payments as (
|
||||
select * from {{ ref("int_core__verification_payments", version=1) }}
|
||||
)
|
||||
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
|
||||
|
|
@ -134,11 +134,6 @@ models:
|
|||
description: Free text description on the payment. Typically, contains explanations for integration issues with the payment processor.
|
||||
|
||||
versions:
|
||||
- v: 1
|
||||
deprecation_date: 2024-10-15 00:00:00.00+00:00
|
||||
config:
|
||||
alias: core__verification_payments
|
||||
|
||||
- v: 2
|
||||
columns:
|
||||
- name: total_amount_in_txn_currency
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ exposures:
|
|||
|
||||
depends_on:
|
||||
- ref('dates')
|
||||
- ref('core__verification_payments', version=1)
|
||||
- ref('core__verification_payments', version=2)
|
||||
|
||||
owner:
|
||||
name: Pablo Martin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue