From 5735251c67b83f90badea71f6d45f4575a5db572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Roqu=C3=A9=20Paniagua?= Date: Fri, 18 Oct 2024 09:59:29 +0000 Subject: [PATCH] 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 --- .../int_core__verification_payments_v1.sql | 59 ------------------- models/intermediate/core/schema.yml | 5 -- .../core/core__verification_payments_v1.sql | 27 --------- models/reporting/core/schema.yml | 5 -- models/reporting/exposures.yml | 2 +- 5 files changed, 1 insertion(+), 97 deletions(-) delete mode 100644 models/intermediate/core/int_core__verification_payments_v1.sql delete mode 100644 models/reporting/core/core__verification_payments_v1.sql diff --git a/models/intermediate/core/int_core__verification_payments_v1.sql b/models/intermediate/core/int_core__verification_payments_v1.sql deleted file mode 100644 index 617cec6..0000000 --- a/models/intermediate/core/int_core__verification_payments_v1.sql +++ /dev/null @@ -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 diff --git a/models/intermediate/core/schema.yml b/models/intermediate/core/schema.yml index e6f7f9b..7e874df 100644 --- a/models/intermediate/core/schema.yml +++ b/models/intermediate/core/schema.yml @@ -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 diff --git a/models/reporting/core/core__verification_payments_v1.sql b/models/reporting/core/core__verification_payments_v1.sql deleted file mode 100644 index afd5715..0000000 --- a/models/reporting/core/core__verification_payments_v1.sql +++ /dev/null @@ -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 diff --git a/models/reporting/core/schema.yml b/models/reporting/core/schema.yml index 2665c9e..f2db7c4 100644 --- a/models/reporting/core/schema.yml +++ b/models/reporting/core/schema.yml @@ -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 diff --git a/models/reporting/exposures.yml b/models/reporting/exposures.yml index a358967..091f896 100644 --- a/models/reporting/exposures.yml +++ b/models/reporting/exposures.yml @@ -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