Merged PR 2063: Part 2 of the previous PR
Adds tests and also places an upper on a field in staging for funky reasons
This commit is contained in:
commit
06fc35e58d
2 changed files with 88 additions and 5 deletions
|
|
@ -349,7 +349,85 @@ models:
|
||||||
description: estimated date from the timestamp of when the verification request was completed.
|
description: estimated date from the timestamp of when the verification request was completed.
|
||||||
|
|
||||||
- name: is_completed_at_overriden_with_used_link_at
|
- name: is_completed_at_overriden_with_used_link_at
|
||||||
data_type: boolean
|
data_type: boolean
|
||||||
description: |
|
description: >
|
||||||
boolean indicating if the estimated dates have been overriden with the used link since
|
boolean indicating if the estimated dates have been overriden with the
|
||||||
the initial computation was still considering an end date before a starting date.
|
used link since the initial computation was still considering an end
|
||||||
|
date before a starting date.
|
||||||
|
|
||||||
|
- name: int_core__verification_payments
|
||||||
|
description: >-
|
||||||
|
A simplified table that holds guest journey payments with details around
|
||||||
|
when they happen, what service was being paid, what was the related
|
||||||
|
verification request, etc.
|
||||||
|
|
||||||
|
Currency rates are converted to GBP with our simple exchange rates view.
|
||||||
|
columns:
|
||||||
|
- name: id_verification_to_payment
|
||||||
|
data_type: bigint
|
||||||
|
description: Unique ID for the relation between the payment verification
|
||||||
|
and the payment at hand.
|
||||||
|
tests:
|
||||||
|
- unique
|
||||||
|
- not_null
|
||||||
|
- name: id_payment
|
||||||
|
data_type: bigint
|
||||||
|
description: Unique ID for the payment itself.
|
||||||
|
tests:
|
||||||
|
- unique
|
||||||
|
- not_null
|
||||||
|
- name: is_refundable
|
||||||
|
data_type: boolean
|
||||||
|
- name: created_at_utc
|
||||||
|
data_type: timestamp without time zone
|
||||||
|
- name: updated_at_utc
|
||||||
|
data_type: timestamp without time zone
|
||||||
|
- name: payment_due_at_utc
|
||||||
|
data_type: timestamp without time zone
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- name: payment_due_date_utc
|
||||||
|
data_type: date
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- name: payment_paid_at_utc
|
||||||
|
data_type: timestamp without time zone
|
||||||
|
- name: payment_paid_date_utc
|
||||||
|
data_type: date
|
||||||
|
- name: payment_reference
|
||||||
|
data_type: character varying
|
||||||
|
- name: refund_due_at_utc
|
||||||
|
data_type: timestamp without time zone
|
||||||
|
- name: refund_due_date_utc
|
||||||
|
data_type: date
|
||||||
|
- name: payment_refunded_at_utc
|
||||||
|
data_type: timestamp without time zone
|
||||||
|
- name: payment_refunded_date_utc
|
||||||
|
data_type: date
|
||||||
|
- name: refund_payment_reference
|
||||||
|
data_type: character varying
|
||||||
|
- name: id_guest_user
|
||||||
|
data_type: character varying
|
||||||
|
- name: id_verification
|
||||||
|
data_type: bigint
|
||||||
|
- name: id_verification_request
|
||||||
|
data_type: bigint
|
||||||
|
- name: verification_payment_type
|
||||||
|
data_type: character varying
|
||||||
|
- name: amount_in_txn_currency
|
||||||
|
data_type: numeric
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- name: currency
|
||||||
|
data_type: character varying
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- name: amount_in_gbp
|
||||||
|
data_type: numeric
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- name: payment_status
|
||||||
|
data_type: character varying
|
||||||
|
- name: notes
|
||||||
|
data_type: character varying
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,12 @@ with
|
||||||
cast({{ adapter.quote("RefundDate") }} as date) as refunded_date_utc,
|
cast({{ adapter.quote("RefundDate") }} as date) as refunded_date_utc,
|
||||||
{{ adapter.quote("CreatedDate") }} as created_at_utc,
|
{{ adapter.quote("CreatedDate") }} as created_at_utc,
|
||||||
cast({{ adapter.quote("CreatedDate") }} as date) as created_date_utc,
|
cast({{ adapter.quote("CreatedDate") }} as date) as created_date_utc,
|
||||||
{{ adapter.quote("CurrencyIso") }} as currency,
|
-- The field in SQL Server is this funny case insensitive shit that is
|
||||||
|
-- supposed to not be case sensitive due to the db collation but somehow
|
||||||
|
-- does store different cases. There is one pesky record where EUR is
|
||||||
|
-- stored as Eur. I placed this upper to save us from this and future
|
||||||
|
-- weird ones.
|
||||||
|
upper({{ adapter.quote("CurrencyIso") }}) as currency,
|
||||||
{{ adapter.quote("PaymentDate") }} as paid_at_utc,
|
{{ adapter.quote("PaymentDate") }} as paid_at_utc,
|
||||||
cast({{ adapter.quote("PaymentDate") }} as date) as paid_date_utc,
|
cast({{ adapter.quote("PaymentDate") }} as date) as paid_date_utc,
|
||||||
{{ adapter.quote("UpdatedDate") }} as updated_at_utc,
|
{{ adapter.quote("UpdatedDate") }} as updated_at_utc,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue