diff --git a/CHANGELOG.md b/CHANGELOG.md index cbb366b8..d1a79155 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/dbt_project.yml b/dbt_project.yml index a08e0118..84e0eb7c 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -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"] @@ -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 diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 9cc6f859..c18b3297 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,7 +1,7 @@ config-version: 2 name: 'stripe_source_integration_tests' -version: '0.7.0' +version: '0.7.1' profile: 'integration_tests' diff --git a/macros/get_invoice_columns.sql b/macros/get_invoice_columns.sql index 89666511..3997f1a1 100644 --- a/macros/get_invoice_columns.sql +++ b/macros/get_invoice_columns.sql @@ -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()}, diff --git a/models/src_stripe.yml b/models/src_stripe.yml index a5bec2aa..bba4cef9 100644 --- a/models/src_stripe.yml +++ b/models/src_stripe.yml @@ -381,6 +381,8 @@ sources: description: This is the transaction number that appears on email receipts sent for this invoice. - name: status description: Status of the invoice. + - name: subscription_id + description: The ID of the subscription that the invoice item pertains to, if any. - name: subtotal description: Total of all subscriptions, invoice items, and prorations on the invoice before any discount or tax is applied. - name: tax diff --git a/models/stg_stripe.yml b/models/stg_stripe.yml index 6277cdc5..6ab6b0a7 100644 --- a/models/stg_stripe.yml +++ b/models/stg_stripe.yml @@ -369,6 +369,8 @@ models: description: This is the transaction number that appears on email receipts sent for this invoice. - name: status description: Status of the invoice. + - name: subscription_id + description: The ID of the subscription that the invoice item pertains to, if any. - name: subtotal description: Total of all subscriptions, invoice items, and prorations on the invoice before any discount or tax is applied. - name: tax diff --git a/models/stg_stripe__invoice.sql b/models/stg_stripe__invoice.sql index 06660e1a..49fe6341 100644 --- a/models/stg_stripe__invoice.sql +++ b/models/stg_stripe__invoice.sql @@ -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 %}