From 4f27612a1b9c622332c763960449f5aacb6fe00a Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Fri, 16 Feb 2024 16:51:39 +0100 Subject: [PATCH] charges fields finished --- models/staging/stripe/stg_stripe__charges.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/models/staging/stripe/stg_stripe__charges.sql b/models/staging/stripe/stg_stripe__charges.sql index 55192bb..d56a904 100644 --- a/models/staging/stripe/stg_stripe__charges.sql +++ b/models/staging/stripe/stg_stripe__charges.sql @@ -6,7 +6,7 @@ with {{ adapter.quote("card") }}, cast({{ adapter.quote("paid") }} as bool) as is_paid, {{ adapter.quote("order") }}, - {{ adapter.quote("amount") }} / 100, + {{ adapter.quote("amount") }} / 100 as amount, {{ adapter.quote("object") }}, {{ adapter.quote("review") }}, {{ adapter.quote("source") }}, @@ -16,14 +16,14 @@ with {{ adapter.quote("invoice") }}, {{ adapter.quote("outcome") }}, {{ adapter.quote("refunds") }}, - {{ adapter.quote("updated") }}, - {{ adapter.quote("captured") }}, + to_timestamp({{ adapter.quote("updated") }}) as updated_at_utc, + cast({{ adapter.quote("captured") }} as bool) as is_captured, {{ adapter.quote("currency") }}, {{ adapter.quote("customer") }}, - {{ adapter.quote("disputed") }}, - {{ adapter.quote("livemode") }}, + cast({{ adapter.quote("disputed") }} as bool) as is_disputed, + cast({{ adapter.quote("livemode") }} as bool) as is_livemode, {{ adapter.quote("metadata") }}, - {{ adapter.quote("refunded") }}, + cast({{ adapter.quote("refunded") }} as bool) as is_refunded, {{ adapter.quote("shipping") }}, {{ adapter.quote("application") }}, {{ adapter.quote("description") }}, @@ -39,8 +39,8 @@ with {{ adapter.quote("payment_method") }}, {{ adapter.quote("receipt_number") }}, {{ adapter.quote("transfer_group") }}, - {{ adapter.quote("amount_captured") }}, - {{ adapter.quote("amount_refunded") }}, + {{ adapter.quote("amount_captured") }} / 100 as amount_captured, + {{ adapter.quote("amount_refunded") }} / 100 as amount_refunded, {{ adapter.quote("application_fee") }}, {{ adapter.quote("billing_details") }}, {{ adapter.quote("failure_message") }},