Skip to content

Build invoice payment cohort analyzer #236

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

For creator analytics dashboards, group invoices by creation-week/month cohorts and compute funding-completion rates per cohort, to visualize trends over time.

Technical Context

New src/cohortAnalyzer.ts. Buckets Invoice[] by configurable time period (week/month) using Invoice creation timestamp data, computes completion rate per bucket.

Acceptance Criteria

  • analyzeCohorts(invoices, period: "week"|"month") returns ordered cohort buckets with { period, total, completed, completionRate }
  • Handles sparse data (some periods with zero invoices) without gaps breaking the ordering
  • Pure function, no network calls
  • Tests: weekly bucketing correctness; monthly bucketing correctness; sparse-period handling

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions