Skip to content

Share subscription stats calculation#476

Open
er1c-cartman wants to merge 1 commit into
Smartdevs17:mainfrom
er1c-cartman:stellar-63-shared-stats
Open

Share subscription stats calculation#476
er1c-cartman wants to merge 1 commit into
Smartdevs17:mainfrom
er1c-cartman:stellar-63-shared-stats

Conversation

@er1c-cartman
Copy link
Copy Markdown

Summary

  • Extract shared subscription stats calculation into src/utils/stats.ts
  • Reuse the shared calculation from dummyData.getTotalMonthlySpending() and subscriptionStore.calculateStats()
  • Add focused unit coverage for empty input, mixed billing cycles, inactive subscriptions, category counts, gas totals, and injected currency conversion
  • Restore the malformed subscriptionStore state object so the file parses before the stats refactor runs

Validation

  • PATH=/home/goalie/.local/node-v22/bin:$PATH npx --yes tsx -e "...stats smoke..." -> stats smoke passed
  • PATH=/home/goalie/.local/node-v22/bin:$PATH npx --yes prettier --check src/utils/stats.ts src/utils/__tests__/stats.test.ts src/utils/dummyData.ts src/store/subscriptionStore.ts
  • git diff --check

Dependency note

  • npm ci currently fails on upstream dependency metadata before tests can run locally: first with the ethers peer conflict, then with No matching version found for @react-native/jest-preset@^0.1.0 when retried with --legacy-peer-deps.

Closes #63

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.

🔧 Share calculateStats logic with dummyData

2 participants