Skip to content

Commit

Permalink
DEAR-132 add todo
Browse files Browse the repository at this point in the history
  • Loading branch information
smuefsmuef committed Aug 6, 2024
1 parent 6d4c0e3 commit 53304dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@Repository
public interface InsightsRepository extends JpaRepository<HappinessSurvey, Integer> {

// todo review & refactor queries

// team overall happiness - no daterange
@Query("SELECT CAST(submitted AS DATE) as day, AVG(score) as average " +
"FROM HappinessSurvey " +
Expand Down Expand Up @@ -127,7 +129,7 @@ List<Object[]> findTopEmotionsByTeamAndDateRange(@Param("teamId") Integer teamId
"ORDER BY teamCount DESC")
List<Object[]> findTopEmotionsByTeam(@Param("teamId") Integer teamId);

// todo bugs with this counter queries

// Query to get the distinct workkind count and list of workkind IDs for a specific user on each day, no date range
@Query("SELECT DATE_TRUNC('day', wks.submitted) AS dateTime, " +
"COUNT(DISTINCT wks.workKindId) AS workKindCount " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public List<HappinessInsightDTO> getHappinessInsightsByTeam(@ValidateUserIdParam
userAverages = happinessSurveyRepository.findDailyAveragesByUserId(userId);
teamAverages = insightsRepository.findTeamDailyAverages(teamId);
} else {
// todo make sure the sprint belongs to the team
SprintConfig sprintConfig = sprintConfigRepository.findById(sprintId)
.orElseThrow(() -> new IllegalArgumentException("Invalid sprint ID: " + sprintId));

Expand Down

0 comments on commit 53304dc

Please sign in to comment.