core__verification_payments_v2
This commit is contained in:
parent
9e62786aa9
commit
40bfa60016
4 changed files with 71 additions and 34 deletions
27
models/reporting/core/core__verification_payments_v1.sql
Normal file
27
models/reporting/core/core__verification_payments_v1.sql
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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
|
||||
|
|
@ -19,11 +19,9 @@ select
|
|||
vp.id_guest_user as id_guest_user,
|
||||
vp.id_verification as id_verification,
|
||||
vp.verification_payment_type as verification_payment_type,
|
||||
vp.total_amount_in_txn_currency as amount_in_txn_currency, -- LEGACY
|
||||
vp.total_amount_in_txn_currency as total_amount_in_txn_currency,
|
||||
vp.amount_without_taxes_in_txn_currency as amount_without_taxes_in_txn_currency,
|
||||
vp.currency as currency,
|
||||
vp.total_amount_in_gbp as amount_in_gbp, -- LEGACY
|
||||
vp.total_amount_in_gbp as total_amount_in_gbp,
|
||||
vp.amount_without_taxes_in_gbp as amount_without_taxes_in_gbp,
|
||||
vp.payment_status as payment_status,
|
||||
|
|
@ -2,6 +2,7 @@ version: 2
|
|||
|
||||
models:
|
||||
- name: core__verification_payments
|
||||
latest_version: 2
|
||||
description: |
|
||||
Payments that have happened as part of the Guest Journey.
|
||||
|
||||
|
|
@ -108,22 +109,6 @@ models:
|
|||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: total_amount_in_txn_currency
|
||||
data_type: numeric
|
||||
description: The payment amount in the currency in which the transaction actually happened. If the guest paid in Australian Dollars, this is measured in AUD.
|
||||
tests:
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: amount_without_taxes_in_txn_currency
|
||||
data_type: numeric
|
||||
description: The payment amount without taxes in the currency in which the transaction actually happened. If the guest paid in Australian Dollars, this is measured in AUD. (To be decommissioned)
|
||||
tests:
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: currency
|
||||
data_type: character varying
|
||||
description: The currency in which the transaction actually happened. If the guest paid in Australian Dollars, this is measured in AUD.
|
||||
|
|
@ -138,22 +123,6 @@ models:
|
|||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: total_amount_in_gbp
|
||||
data_type: numeric
|
||||
description: The payment amount value, converted to GBP, using the exchange rate for the day on which the payment happened.
|
||||
tests:
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: amount_without_taxes_in_gbp
|
||||
data_type: numeric
|
||||
description: The payment amount value without taxes, converted to GBP, using the exchange rate for the day on which the payment happened.
|
||||
tests:
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: payment_status
|
||||
data_type: character varying
|
||||
description: "The status of the payment. It can be one of: Paid, Refunded, Refund Failed, Cancelled, Paid Manually, Unpaid."
|
||||
|
|
@ -164,6 +133,49 @@ models:
|
|||
data_type: character varying
|
||||
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
|
||||
data_type: numeric
|
||||
description: The payment amount in the currency in which the transaction actually happened. If the guest paid in Australian Dollars, this is measured in AUD.
|
||||
tests:
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: amount_without_taxes_in_txn_currency
|
||||
data_type: numeric
|
||||
description: The payment amount without taxes in the currency in which the transaction actually happened. If the guest paid in Australian Dollars, this is measured in AUD. (To be decommissioned)
|
||||
tests:
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: total_amount_in_gbp
|
||||
data_type: numeric
|
||||
description: The payment amount value, converted to GBP, using the exchange rate for the day on which the payment happened.
|
||||
tests:
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- name: amount_without_taxes_in_gbp
|
||||
data_type: numeric
|
||||
description: The payment amount value without taxes, converted to GBP, using the exchange rate for the day on which the payment happened.
|
||||
tests:
|
||||
- dbt_expectations.expect_column_values_to_be_between:
|
||||
min_value: 0
|
||||
strictly: false
|
||||
|
||||
- include: all
|
||||
exclude: [amount_in_txn_currency, amount_in_gbp]
|
||||
|
||||
- name: core__bookings
|
||||
description: |
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue