Skip to content

Fix MRR reactivation/new classification and refund fan-out in line_item_enhanced - #162

Open
porkedchop wants to merge 1 commit into
fivetran:mainfrom
porkedchop:fix-refund-fanout
Open

porkedchop wants to merge 1 commit into
fivetran:mainfrom
porkedchop:fix-refund-fanout

Conversation

@porkedchop

Copy link
Copy Markdown

Resolves #161

Please provide your name and company

Bishop Kammeraad

Describe what this PR changes and how it addresses the linked issue or feature request.

  • stripe__subscription_item_mrr_report: adds the MRR from two and three months back and whether the item has had MRR before, classifies new as the first month with MRR and checks reactivation (three months at zero) ahead of expansion. The final select lists the documented columns so the helper columns stay internal.
  • stripe__line_item_enhanced: sums refunds and their balance transaction fee per charge in the refund CTE, the same way discounts are summed per invoice, and drops the separate refund balance transaction join.

These change output values, so I left the version and CHANGELOG for you.

How did you validate the changes introduced within this PR, and what warehouse did you use for testing?

DuckDB. Built the integration tests project with the extra rows described in #161 and compared before and after: the paused item's June becomes reactivation, the trial item's first paid month becomes new, the refunded invoice goes from 4 line rows to 2 with refund_amount 500, and every other row is unchanged. dbt build passes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MRR report never classifies reactivation, and line_item_enhanced duplicates line items for charges with several refunds

1 participant