Skip to content

Gamification: GET endpoint for user points and historical progress #190

@vicenlu

Description

@vicenlu

As an ITA Challenge student, I want to access my current total points and a detailed history of when I earned them, so that I can visualize my progress over time through a growth chart (e.g., dates on the X-axis and accumulated points on the Y-axis).
This story provides the data backbone for the "My Progress" section of the user profile, allowing the frontend to plot a timeline of the student's activity and point accumulation.


Project Scope

In Scope:
◦ Creation of a GET endpoint (e.g., /api/v1/me/points/history) that retrieves the current authenticated user's data.
◦ Response data structure must include:
▪ Current Total Points.
▪ Historical Log: An array of entries containing the date of the transaction and the points earned.
◦ Sorting logic to ensure the history is returned in chronological order to facilitate chart rendering.

Out of Scope:
◦ Frontend Graph Implementation.
◦ Point Deductions: This story only handles point additions (positive increments).
◦ Filtering by Type: Filtering history by "challenge" vs "code review" is reserved for future iterations.

Acceptance Criteria

  1. The endpoint must return a 200 OK status with a JSON body containing the totalPoints and a history list.
  2. Each entry in the history list must contain at least a timestamp (ISO 8601) and the points value.
  3. The data must be ordered by date (ascending) so the frontend can plot the X-axis directly.
  4. The system must correctly identify the authenticated user and return only their specific data.
  5. Code must pass SonarLint local checks and include unit tests for the history retrieval logic

Sub-issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions