From c051831d6d64d873fed9b351a36436a4a57df163 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 18 Jun 2024 13:09:45 +0200 Subject: [PATCH 1/4] upper in payments --- models/staging/core/stg_core__payment.sql | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/models/staging/core/stg_core__payment.sql b/models/staging/core/stg_core__payment.sql index e6dce40..8752380 100644 --- a/models/staging/core/stg_core__payment.sql +++ b/models/staging/core/stg_core__payment.sql @@ -12,7 +12,12 @@ with cast({{ adapter.quote("RefundDate") }} as date) as refunded_date_utc, {{ adapter.quote("CreatedDate") }} as created_at_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, cast({{ adapter.quote("PaymentDate") }} as date) as paid_date_utc, {{ adapter.quote("UpdatedDate") }} as updated_at_utc, From 27759374b809838a649f02e6d087515b2b5e4ec7 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 18 Jun 2024 13:10:47 +0200 Subject: [PATCH 2/4] add docs and tests --- models/intermediate/core/schema.yaml | 87 ++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 4 deletions(-) diff --git a/models/intermediate/core/schema.yaml b/models/intermediate/core/schema.yaml index ee88552..9ff7415 100644 --- a/models/intermediate/core/schema.yaml +++ b/models/intermediate/core/schema.yaml @@ -349,7 +349,86 @@ models: description: estimated date from the timestamp of when the verification request was completed. - name: is_completed_at_overriden_with_used_link_at - data_type: boolean - description: | - boolean indicating if the estimated dates have been overriden with the used link since - the initial computation was still considering an end date before a starting date. \ No newline at end of file + data_type: boolean + description: > + boolean indicating if the estimated dates have been overriden with the + used link since + + the initial computation was still considering an end date before a + starting date. + - name: int_core__verification_payments + columns: + - name: id_verification_to_payment + data_type: bigint + description: Unique ID for the rel 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 + 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. From 3d3f3fb9aba42f01d3ff4416124d9924a9c83ded Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 18 Jun 2024 13:40:36 +0200 Subject: [PATCH 3/4] fix docs --- models/intermediate/core/schema.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/models/intermediate/core/schema.yaml b/models/intermediate/core/schema.yaml index 9ff7415..64abec3 100644 --- a/models/intermediate/core/schema.yaml +++ b/models/intermediate/core/schema.yaml @@ -352,15 +352,20 @@ models: data_type: boolean description: > boolean indicating if the estimated dates have been overriden with the - used link since + used link since the initial computation was still considering an end + date before a starting date. - 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 rel between the payment verification and the + description: Unique ID for the relation between the payment verification and the payment at hand. tests: - unique @@ -425,10 +430,4 @@ models: data_type: character varying - name: notes data_type: character varying - 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. From 344419e6601a844c00bcf972fad21427eda8311b Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 18 Jun 2024 13:41:32 +0200 Subject: [PATCH 4/4] formatting --- models/intermediate/core/schema.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/intermediate/core/schema.yaml b/models/intermediate/core/schema.yaml index 64abec3..b626a4c 100644 --- a/models/intermediate/core/schema.yaml +++ b/models/intermediate/core/schema.yaml @@ -365,8 +365,8 @@ models: columns: - name: id_verification_to_payment data_type: bigint - description: Unique ID for the relation between the payment verification and the - payment at hand. + description: Unique ID for the relation between the payment verification + and the payment at hand. tests: - unique - not_null