Implement score table functionality with ScoreTable, ScoreEntry, and ScoreTableService; add Timeframe and ScoreType enums; enhance User and StatsList models for better stats management
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package SuMoC.backend.gamification.badges;
|
||||
|
||||
import SuMoC.backend.gamification.Timeframe;
|
||||
import SuMoC.backend.gamification.badges.models.Badge;
|
||||
import SuMoC.backend.gamification.badges.models.UserBadge;
|
||||
import SuMoC.backend.user.models.User;
|
||||
@@ -43,7 +44,7 @@ public class BadgeService {
|
||||
// Prüfe Kriterien
|
||||
boolean qualifies = badge.getCriteria().entrySet().stream()
|
||||
.allMatch(entry ->
|
||||
user.getStats().getOrDefault(entry.getKey(), 0) >= entry.getValue()
|
||||
user.getStats().getStatValue(Timeframe.TOTAL, entry.getKey()) >= entry.getValue()
|
||||
);
|
||||
|
||||
if (qualifies) {
|
||||
|
||||
Reference in New Issue
Block a user