Skip to content

🔧 Share calculateStats logic with dummyData #63

@Smartdevs17

Description

@Smartdevs17

Problem

Duplicated stats calculation logic between store and dummyData.

Context

Inconsistent calculations possible, maintenance overhead.

Proposed Solution

Share logic:

  1. Extract stats calculation to shared utility
  2. Import in both places
  3. Test the shared function
  4. Remove duplication

Acceptance Criteria

  • Single stats calculation
  • Tests pass
  • Consistent results
  • Less code

Technical Notes

Files:

  • src/store/subscriptionStore.ts
  • src/utils/dummyData.ts
    New: src/utils/stats.ts

Constraints

  • Handle empty data
  • Match existing outputs
  • Consider performance

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions