You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* partition rolling totals in stripe__daily_overview by account_id and source_relation
* join balance transactions and failed charges on the account, and put source_relation in the daily surrogate key
* feature/add_historic_pricing_to_mrr_report
* Update CHANGELOG.md
* Generate dbt docs via GitHub Actions
* update_partition_macro
* Generate dbt docs via GitHub Actions
* add_contributor
* update_changelog
---------
Co-authored-by: Muhammed Rasin O M <rasinbinabdulla@gmail.com>
Co-authored-by: fivetran-data-model-bot <fivetran-data-model-bot@users.noreply.github.com>
|`stripe__daily_overview`| Changed field (**breaking change**) | surrogate key hashed on `account_id` and `date_day`. | surrogate key hashed on `source_relation`, `account_id`, and `date_day`. | Two unioned connectors that share an account ID and a date previously produced the same key. |
11
+
|`stripe__daily_overview`| Possible changed data (possible breaking change)| Each `rolling_*` column accumulated across all accounts. | Each `rolling_*` column is the running total of its own `account_id` and `source_relation`. | Only affects destinations with more than one account or more than one unioned connector. Single-account output is unchanged. See [#155](https://github.com/fivetran/dbt_stripe/issues/155). |
12
+
|`stripe__daily_overview`<br>`int_stripe__account_daily`| Changed join (possible breaking change) | Balance transactions and failed charges join to the date spine on the date and `source_relation` only, so every account counts every other account's activity as its own. | Both joins also match on the account. | Only affects destinations with more than one account. Transactions with no `connected_account_id` still count toward every account; see the [DECISIONLOG](https://github.com/fivetran/dbt_stripe/blob/main/DECISIONLOG.md#daily-overview-attribution-for-transactions-without-a-connected-account) for why. Single-account output is unchanged. |
13
+
|`stripe__subscription_item_mrr_report`| Changed model (possible breaking change) | Historical months apply the item's current `price_plan` unit amount. | Historical months apply the `unit_amount_excluding_tax` from the invoice line that billed them, carried forward across gap months. | MRR now reflects a price change from the month it took effect instead of applying today's price across all history, so historical `month_contract_mrr`, `month_discount_applied`, `month_billed_mrr`, and `contract_mrr_type` values change. Months with no invoiced unit amount still use the live `price_plan` unit amount. See the [DECISIONLOG](https://github.com/fivetran/dbt_stripe/blob/main/DECISIONLOG.md#mrr-history-anchored-to-each-subscription-items-creation-date). |
14
+
|`stg_stripe__invoice_line_item`| New field ||`unit_amount_excluding_tax`||
Copy file name to clipboardExpand all lines: DECISIONLOG.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,20 @@
1
+
## Daily Overview Attribution for Transactions Without a Connected Account
2
+
3
+
The `stripe__daily_overview` model attributes each balance transaction and failed charge to the account named in its `connected_account_id`. When that field is null, the transaction counts toward every account on the destination.
4
+
5
+
Stripe populates `connected_account_id` only for Connect activity tied to a connected account, so a null means the activity belongs to the platform account. The `account` source table gives us no reliable way to identify that platform account, so we do not guess. For a single-account destination this is correct, since every transaction is null. For a Connect destination, each connected account's own activity is attributed only to it, but platform activity still counts toward every account and can overstate those totals. If this affects your reporting, please open a [feature request](https://github.com/fivetran/dbt_stripe/issues/new?template=feature-request.yml).
6
+
1
7
## MRR History Anchored to Each Subscription Item's Creation Date
2
8
3
9
The `stripe__subscription_item_mrr_report` model anchors each item's MRR timeline to that item's `created_at`, reporting MRR from when the item was added through the current month.
4
10
5
11
Because `subscription_item` retains only the current state of each item, we reconstruct historical quantity from `invoice_line_item`, which records the quantity actually billed for each period. For each month, we use the quantity from the most recent invoice line whose period overlaps that month (proration adjustment lines excluded); the current month uses the live `subscription_item` quantity. This lets the report surface real `expansion` and `contraction` between months rather than back-projecting today's quantity across all history.
6
12
7
-
Because this model depends on `invoice_line_item` for historical quantity, it requires `stripe__using_invoices` (enabled by default) and does not build when that variable is disabled. Stripe generates an invoice each billing period, so gaps are not expected, but when a month has no invoice line we carry the most recent prior invoiced quantity forward rather than snapping to today's quantity (which would invent phantom changes in the gap). A month falls back to the current `subscription_item` quantity only when no earlier invoice exists (months before the first invoice). Prices are not back-filled — historical months apply the item's current price.
13
+
Because this model depends on `invoice_line_item` for historical quantity, it requires `stripe__using_invoices` (enabled by default) and does not build when that variable is disabled. Stripe generates an invoice each billing period, so gaps are not expected, but when a month has no invoice line we carry the most recent prior invoiced quantity forward rather than snapping to today's quantity (which would invent phantom changes in the gap). A month falls back to the current `subscription_item` quantity only when no earlier invoice exists (months before the first invoice).
14
+
15
+
Price is reconstructed the same way. Each month uses the most recent invoiced `unit_amount_excluding_tax`, carried forward across gap months, so a price change is reflected from the month it took effect rather than applied backwards across all history. The current month uses the live `price_plan` unit amount. A month falls back to the live `price_plan` unit amount when no earlier invoice line carries a unit amount, which includes invoices synced before Stripe began populating the field.
16
+
17
+
Price and quantity carry forward independently, so each month uses the most recent value available for each. When an invoice line records one but not the other, a month can take its price and its quantity from different invoice lines. Where both are present, which is the normal case, both come from the same line.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ Include the following stripe package version in your `packages.yml` file:
80
80
```yaml
81
81
packages:
82
82
- package: fivetran/stripe
83
-
version: [">=1.9.0", "<1.10.0"]
83
+
version: [">=1.10.0", "<1.11.0"]
84
84
```
85
85
> All required sources and staging models are now bundled into this transformation package. Do not include `fivetran/stripe_source` in your `packages.yml` since this package has been deprecated.
0 commit comments