Skip to content

Spending pattern analysis #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jun 23, 2025
Merged

Spending pattern analysis #124

merged 22 commits into from
Jun 23, 2025

Conversation

gjong
Copy link
Contributor

@gjong gjong commented Jun 14, 2025

Breaking change

Proposed change

Add the initial version for spending pattern detection and spending insight detection.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the application)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

gjong added 4 commits June 12, 2025 20:56
…ection.

Removed redundant embedding store implementations, transitioning to a unified factory-based approach. Introduced seasonal spending pattern detection with corresponding database schema changes and providers. Updated logging and configuration to support the new features.
Introduced rule engine integration in transaction processing, enabling automated rule application with detailed logging and efficient pagination. Updated spending insights and patterns database schema for improved precision using `decimal` type and `BIGSERIAL` for IDs. Adjusted scheduled task for spending analysis to execute on the 15th of each month.
Introduce the AnalyzeJob framework for scheduling, processing, and persisting spending analysis tasks. This includes JPA entities, repositories, message commands, a scheduler, and logging enhancements to streamline the monthly analysis workflow.
Refactored code for spending pattern detection to improve readability, maintainability, and functionality. Added comprehensive unit tests for `SeasonalPattern`, `AmountPattern`, and anomaly detection to ensure robust logic and error handling. Minor optimizations and cleanup in related modules.
@gjong
Copy link
Contributor Author

gjong commented Jun 14, 2025

Unresolved for now:

  • Exposing the data to the User either by e-mail or through the UI (undecided at this point in time)

@gjong gjong added the enhancement New feature or request label Jun 14, 2025
@gjong gjong force-pushed the spending-pattern-analysis branch from 14ad6bf to b7ec7c2 Compare June 21, 2025 13:43
gjong added 4 commits June 21, 2025 18:42
Introduced custom `MockitoConfiguration` for mock behaviors with better handling of `Optional`, `Sequence`, and `ResultPage` types. Enhanced `PatternDetector` and `AnomalyDetector` with new test cases and refined logic for detecting and updating spending patterns, improving reliability and coverage.
Revised `CreateSpendingInsight` and `CreateSpendingPattern` commands to use flat field structures instead of nested objects. Updated related JPA providers and tests to reflect these changes, enhancing clarity and reducing coupling.
Introduced a test to verify that EmbeddingStoreFiller correctly executes the callback for transactions. It ensures event publishing and proper integration with executor services are working as expected.
Introduced new endpoints to retrieve spending insights and patterns for a specific year and month. Implemented respective response models, endpoint logic, and comprehensive test coverage to ensure correct functionality and data integrity.
Copy link

@gjong gjong merged commit 84eeba7 into master Jun 23, 2025
8 checks passed
@gjong gjong deleted the spending-pattern-analysis branch June 23, 2025 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant