Skip to content

feat: build subscription proration calculator with transparency (#784)#809

Open
morelucks wants to merge 1 commit into
Smartdevs17:mainfrom
morelucks:feature/subscription-proration-calculator-784
Open

feat: build subscription proration calculator with transparency (#784)#809
morelucks wants to merge 1 commit into
Smartdevs17:mainfrom
morelucks:feature/subscription-proration-calculator-784

Conversation

@morelucks

Copy link
Copy Markdown
Contributor

Description

Closes #784

This PR implements a transparent subscription proration calculator that provides exact-day calculations, itemized line-item breakdowns, human-readable explanations, tax handling, credit balance applications, analytics, and documentation.

Summary of Changes

  • Proration Calculator Engine: Implemented exact-day daily-rate calculations for upgrades, downgrades, cancellations, and billing cycle changes in prorationCalculatorService.ts.
  • Transparent Line-Item Breakdown: Itemized unused time credited vs. remaining time charged with automatic human-readable explanation generation.
  • Proration Types & Config: Created prorationCalculator.ts covering configuration rules, breakdown items, calculation requests/results, and analytics summaries.
  • State Management & Hook: Built persistent Zustand store prorationStore.ts and React hook useProrationCalculator.ts.
  • UI Screen Component: Added ProrationCalculatorScreen.tsx with calculator inputs, transparent breakdown display, and analytics dashboard tabs.
  • Backend API Service: Created prorationApiService.ts and exported in backend service index.
  • Testing & Docs: Added unit tests in prorationCalculatorService.test.ts and documentation in subscription-proration-calculator.md.

…tdevs17#784)

- Add subscription proration types and default configurations (prorationCalculator.ts)
- Implement exact-day proration calculator engine with line-item transparency and human-readable explanation generator (prorationCalculatorService.ts)
- Build persistent Zustand store for proration previews, applied history, and config management (prorationStore.ts)
- Create React hook useProrationCalculator and UI screen component ProrationCalculatorScreen
- Add backend ProrationApiService for REST API integration
- Implement unit tests covering calculations, downgrades, credits, tax, and analytics aggregation
- Add detailed technical documentation for subscription proration calculator

Closes Smartdevs17#784
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@morelucks Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Build subscription proration calculator with transparency

1 participant