Skip to content

feat(backend): Add org statistics endpoint with daily/weekly/monthly aggregates #660

Description

@FaveTeamz

Summary

Org maintainers have no way to view statistics about their organization's activity: how many applications were received, assignments made, or completions logged over a period. This data is essential for org governance and capacity planning.

Problem

Maintainers must manually count events from the event history to understand their org's activity trends. There is no API endpoint providing pre-aggregated statistics.

Acceptance Criteria

  • Add GET /api/orgs/:org_id/stats?period=7d|30d|90d endpoint
  • Response includes: total applications, total assignments, total completions, total revocations, unique contributors, avg time to assignment (hours), avg time to completion (hours)
  • Time series data: daily counts for the requested period (for charting)
  • Cache results for 15 minutes in Redis
  • Require a valid API key associated with the org (maintainer or admin)
  • Return 404 if org_id is not registered
  • Document endpoint in docs/api-reference.md with example response

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend service

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions