Skip to content

Implemented Retrieval & Statistics Endpoints#222

Merged
phertyameen merged 2 commits intoMindBlockLabs:mainfrom
Mkalbani:feat/retrieval_stats
Jan 29, 2026
Merged

Implemented Retrieval & Statistics Endpoints#222
phertyameen merged 2 commits intoMindBlockLabs:mainfrom
Mkalbani:feat/retrieval_stats

Conversation

@Mkalbani
Copy link
Contributor

This closes #171

Summary of Implementation

  • 3 Read-only Endpoints Created:

  • GET /progress - Paginated answer history ordered by attemptedAt DESC

  • GET /progress/stats - Overall stats (total attempts, correct, accuracy %, points, time spent)

  • GET /progress/category/:id - Category stats (attempts, correct answers, accuracy %)

Key Implementation Details:

  • Efficient QueryBuilder - All queries use TypeORM QueryBuilder with proper aggregations
  • Leveraged Indexes - Queries use indexed columns: [userId, attemptedAt], [userId, puzzleId], [categoryId]
  • Pagination Support - Uses existing pagination helper with configurable limit/page
  • Auth Protected - JWT authentication via @UseGuards(AuthGuard('jwt'))
  • DTOs Created:
  • ProgressHistoryDto
  • CategoryStatsDto
  • OverallStatsDto
  • PaginatedProgressDto

Copy link
Member

@phertyameen phertyameen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have a dependency error. Please look into it. Image

@Mkalbani Mkalbani force-pushed the feat/retrieval_stats branch from 9543aa0 to a9be904 Compare January 29, 2026 20:10
@Mkalbani
Copy link
Contributor Author

@phertyameen done!!

Copy link
Member

@phertyameen phertyameen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awsome. Do apply for more issues in the future. Smiles!

@phertyameen phertyameen merged commit c08a5c9 into MindBlockLabs:main Jan 29, 2026
3 checks passed
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.

Progress Retrieval & Statistics Endpoints

2 participants