From 63b73e3e72200cef228441e1da67cbe8b2d1cfe4 Mon Sep 17 00:00:00 2001 From: Tristan Handy Date: Wed, 7 Jun 2017 16:26:42 -0400 Subject: [PATCH 1/4] updated the charges model to pull the correct id --- models/event_filters/stripe_charges.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/event_filters/stripe_charges.sql b/models/event_filters/stripe_charges.sql index 3ec7406..83bc0f8 100644 --- a/models/event_filters/stripe_charges.sql +++ b/models/event_filters/stripe_charges.sql @@ -5,7 +5,7 @@ with charges as ( ) select - id, + data__object__id as id, data__object__customer as customer_id, data__object__invoice as invoice_id, data__object__balance_transaction as balance_transaction_id, From 0e6e802d76b43388e3de6b6d32925149e658c60f Mon Sep 17 00:00:00 2001 From: Tristan Handy Date: Wed, 7 Jun 2017 18:15:24 -0400 Subject: [PATCH 2/4] add event id as well --- models/event_filters/stripe_charges.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/event_filters/stripe_charges.sql b/models/event_filters/stripe_charges.sql index 83bc0f8..b872a06 100644 --- a/models/event_filters/stripe_charges.sql +++ b/models/event_filters/stripe_charges.sql @@ -5,7 +5,8 @@ with charges as ( ) select - data__object__id as id, + id as event_id, + data__object__id as charge_id, data__object__customer as customer_id, data__object__invoice as invoice_id, data__object__balance_transaction as balance_transaction_id, From a4d9a7cef256218082a63a23ecedad5eb046e231 Mon Sep 17 00:00:00 2001 From: Tristan Handy Date: Wed, 7 Jun 2017 18:16:53 -0400 Subject: [PATCH 3/4] rename file to be idiomatic --- .../{stripe_charges.sql => stripe_charge_events.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename models/event_filters/{stripe_charges.sql => stripe_charge_events.sql} (100%) diff --git a/models/event_filters/stripe_charges.sql b/models/event_filters/stripe_charge_events.sql similarity index 100% rename from models/event_filters/stripe_charges.sql rename to models/event_filters/stripe_charge_events.sql From 62bf643bd0d392c27a81099ff885e934fdec67ea Mon Sep 17 00:00:00 2001 From: Tristan Handy Date: Wed, 7 Jun 2017 18:32:31 -0400 Subject: [PATCH 4/4] fix 'funded' --- models/event_filters/stripe_charge_events.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/event_filters/stripe_charge_events.sql b/models/event_filters/stripe_charge_events.sql index b872a06..d59c8c3 100644 --- a/models/event_filters/stripe_charge_events.sql +++ b/models/event_filters/stripe_charge_events.sql @@ -11,7 +11,7 @@ select data__object__invoice as invoice_id, data__object__balance_transaction as balance_transaction_id, data__object__amount as amount, - trim('charge.' from "type") as result, + replace("type", 'charge.', '') as result, data__object__created as created_at from charges where "type" like 'charge.%'