Skip to content

Commit e16cb20

Browse files
matiwinnetouMateusz Czeladka
and
Mateusz Czeladka
committed
feat: fix for category level stats. (#444)
Co-authored-by: Mateusz Czeladka <mateusz.czeladka@cardanofoundation.org>
1 parent 6c3e073 commit e16cb20

File tree

1 file changed

+1
-1
lines changed
  • backend-services/voting-app/src/main/java/org/cardano/foundation/voting/repository

1 file changed

+1
-1
lines changed

backend-services/voting-app/src/main/java/org/cardano/foundation/voting/repository/VoteRepository.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public interface VoteRepository extends JpaRepository<Vote, String> {
2727
@Query("SELECT v.categoryId as categoryId, COUNT(v) AS totalVoteCount, SUM(v.votingPower) AS totalVotingPower FROM Vote v WHERE v.eventId = :eventId GROUP BY categoryId")
2828
List<HighLevelCategoryLevelStats> getHighLevelCategoryLevelStats(@Param("eventId") String eventId);
2929

30-
@Query("SELECT v.categoryId as categoryId, v.proposalId AS proposalId, COUNT(v) AS totalVoteCount, SUM(v.votingPower) AS totalVotingPower FROM Vote v WHERE v.eventId = :eventId AND v.categoryId = :categoryId GROUP BY proposalId")
30+
@Query("SELECT v.categoryId as categoryId, v.proposalId AS proposalId, COUNT(v) AS totalVoteCount, SUM(v.votingPower) AS totalVotingPower FROM Vote v WHERE v.eventId = :eventId AND v.categoryId = :categoryId GROUP BY categoryId, proposalId ORDER BY totalVotingPower DESC, totalVoteCount DESC")
3131
List<CategoryLevelStats> getCategoryLevelStats(@Param("eventId") String eventId, @Param("categoryId") String categoryId);
3232

3333
interface CategoryProposalProjection {

0 commit comments

Comments
 (0)