Achievements Module & Most frequent spending items endpoint#17
Merged
Conversation
…ries, responses, and event listener
…checks in SavingGoalService
…update SavingGoalService configuration
… listener for achievement unlocks
Introduce AchievementCode enum and add a code field to Achievement. Extend AchievementEarnedEvent with Arabic title/description and targetValue. Add paginated repository queries (missing achievements, distinct user IDs) and update UserAchievement repository. Implement seeding, paginated user-achievement syncing and per-user checks in AchievementService, plus a weekly AchievementScheduler. Refactor achievement flow (renamed listener, use SavingBalanceRepository, new update/unlock logic). Update SavingGoalService calls and integration tests to use codes and numeric BigDecimal literals. Improves scalability, i18n and background syncing of achievements.
Decouple achievement tracking from direct service calls by introducing a cross-module event system. AuthService, SavingGoalService, and TransactionService now publish domain events (UserLoggedInEvent, SavingGoalCompletedEvent, SavingsBalanceUpdatedEvent, TransactionCreatedEvent) that achievement listeners consume asynchronously. Add new achievement types: - Login streak (3, 7, 15, 30 day milestones) - Transaction streak (daily transaction tracking) - Category diversity (logging transactions in multiple categories) Introduce streak tracking entities (LoginStreak, TransactionStreak) and repositories with efficient count-based progress tracking. Update achievement codes and types to support the new categories. Improve AchievementType enum with safe fallback for string conversion.
Refactor/goals achievements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Achievements Module & Spending Analytics
Summary
This PR introduces the Gamified Achievements Module with event-driven notifications and adds an endpoint for retrieving the most frequent spending items.
Changes
Achievements Module
AchievementEarnedEvent.en/ar).Spending Analytics
Testing