Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding subscription_id in invoice table for use in the main stripe pa… #41

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# dbt_stripe_source v0.7.1
## 🎉 Documentation and Feature Updates
- Addition of subscription Id in the invoice tables
- updating the get_invoice_columns.sql with subscription_id field and adding subscription_id in stg_stripe__invoice.sql for above change
# dbt_stripe_source v0.7.0
## 🎉 Documentation and Feature Updates
- Updated README documentation updates for easier navigation and setup of the dbt package
Expand Down
5 changes: 3 additions & 2 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2

name: 'stripe_source'
version: '0.7.0'
version: '0.7.1'

require-dbt-version: [">=1.0.0", "<2.0.0"]

Expand Down Expand Up @@ -31,6 +31,7 @@ vars:
subscription: "{{ source('stripe', 'subscription') }}"
credit_note: "{{ source('stripe', 'credit_note') }}"
credit_note_line_item: "{{ source('stripe', 'credit_note_line_item') }}"


#Variables to enable or disable models if you do not have the respective table.
using_invoices: true
Expand All @@ -39,7 +40,7 @@ vars:
using_subscriptions: true

# variable to exclude or include historical subscription data
stripe__subscription_history: false
fivetran-reneeli marked this conversation as resolved.
Show resolved Hide resolved
stripe__subscription_history: true

# variable to exclude or include test data (based on `livemode`)
using_livemode: true
Expand Down
1 change: 1 addition & 0 deletions macros/get_invoice_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
{"name": "status_transitions_marked_uncollectible_at", "datatype": dbt_utils.type_timestamp()},
{"name": "status_transitions_paid_at", "datatype": dbt_utils.type_timestamp()},
{"name": "status_transitions_voided_at", "datatype": dbt_utils.type_timestamp()},
{"name": "subscription_id", "datatype": dbt_utils.type_string()},
{"name": "subscription_proration_date", "datatype": dbt_utils.type_int()},
{"name": "subtotal", "datatype": dbt_utils.type_int()},
{"name": "tax", "datatype": dbt_utils.type_int()},
Expand Down
5 changes: 3 additions & 2 deletions models/stg_stripe__invoice.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ final as (
subtotal,
tax,
tax_percent,
total

total,
subscription_id

{% if var('stripe__invoice_metadata',[]) %}
, {{ fivetran_utils.pivot_json_extract(string = 'metadata', list_of_properties = var('stripe__invoice_metadata')) }}
{% endif %}
Expand Down