valentyn-vb / valentyn-vb/Recap-Project-6

Dashboard and reporting for Goals and Sessions

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Learning Companion - Dashboard and reporting (Spring Boot)

Use Spring Data JPA's aggregation features for these queries.

Tasks
  • Build a dashboard controller + view showing the count of Goals per status (planned / in-progress / done) for the current user.
  • Implement the status-count query using a JPQL query with GROUP BY (e.g. a @Query method on the GoalRepository returning a projection like List<StatusCount>).
  • Implement a query totaling logged session hours per tag using JPQL GROUP BY on tags (or Criteria API if tags require a join/unnest).
  • Implement a query totaling logged session hours per week, using JPQL date-truncation (e.g. FUNCTION('date_trunc', 'week', s.date)) or a native query if JPQL's date functions are insufficient for PostgreSQL.
  • Render both aggregates on the dashboard page (Thymeleaf template or REST endpoint feeding the existing frontend, matching however the rest of the app is built) as simple tables or bars.
Acceptance criteria
  • Dashboard page/endpoint loads and shows goal counts broken down by status, scoped to the current authenticated user only (via Spring Security principal).
  • Hours-per-tag totals are correct and computed via JPQL/Criteria aggregation — not via pulling all LearningSession rows and summing in a Java loop.
  • Hours-per-week totals are correct and computed via JPQL/Criteria aggregation with a date-truncation function.
  • Both reports only reflect the current user's own goals/sessions (verify with two test users).
  • Tests cover: goal-count-per-status query, hours-per-tag aggregation, hours-per-week aggregation — each verified with @DataJpaTest against known seeded data.
Notes for agent
  • Use a repository method with @Query (JPQL) as the default approach; fall back to the Criteria API only if JPQL can't express the grouping (e.g. complex tag unnesting).
  • Use DTO/interface-based projections (e.g. interface StatusCount { String getStatus(); Long getCount(); }) rather than returning raw Object[] arrays, for readability and type safety.
  • Keep rendering simple (use Primevue) — this is not a charting-library integration task.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating GoalRepository, the dashboard controller/view or REST entry point, and the existing frontend rendering approach. Run the repository tests with @DataJpaTest and seeded data, then verify goal counts, hours per tag, and hours per week for two authenticated users. Done means the dashboard renders all three scoped aggregates and the required tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, postgresql, spring-boot
Domain
backend, database, full-stack, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.