Skip to content

[Feature]: Dashboard Analytics API #124

Description

@SudiptaPaul-31

🔍 Problem Statement

Description
Generate dashboard statistics to provide clients and freelancers with insights into contract activity and financial performance.

Metrics

  • Active contracts count
  • Completed contracts count
  • Total earnings (sum of released escrow amounts)
  • Escrow volume (sum of funds currently held in escrow)

Endpoint

  • GET /api/dashboard/stats → Returns aggregated statistics for the authenticated user

Tasks

  • Define database queries for active/completed contracts
  • Calculate total earnings from released escrow transactions
  • Calculate escrow volume from ongoing contracts
  • Build API response schema with metrics and metadata
  • Add caching or optimization for performance
  • Write unit tests for query logic and endpoint responses

Acceptance Criteria

  • API returns accurate statistics for the authenticated user
  • Endpoint documented for frontend integration
  • Metrics update automatically with contract/escrow changes
  • Graceful error handling for query failures
  • Unit tests pass for all metrics and endpoint logic

📈 Expected Impact

High — Would significantly improve user experience

Metadata

Metadata

Labels

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