Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
F
finwise-miniapp-be
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • ThinhNC
  • finwise-miniapp-be
  • Merge Requests
  • !29

Merged
Opened Aug 19, 2026 by ThinhNC@ThinhNC
  • Report abuse
Report abuse

feat(be): implement 5 advanced financial engineering modules

Overview

This pull request delivers 5 end-to-end full-stack advanced financial features for FinWise Mini App, introducing algorithmic financial forecasting, discrete-event simulation, statistical anomaly detection, automated subscription tracking, and a deterministic natural language query engine.

All features are fully integrated across the stack with Type-Safe Backend Services, Mathematical Engines, Automated Tests, Claymorphism UI Components, TanStack Query Hooks, and Bilingual Localization (VI/EN).


Upgrades Breakdown

1. Cash Flow Runway & Budget Forecaster (/forecast)

  • Backend:
    • Exponential decay weighting for daily burn rate ($\lambda = 0.04$).
    • Mathematical runway projection: $\text{Runway} = \frac{\text{Current Balance}}{\text{Weighted Burn Rate}}$.
    • Data sufficiency validation based on sample variance & count.
    • Active budget exhaustion date prediction and daily spending cap recommendations.
  • Frontend:
    • Interactive forecast horizon switcher (14, 30, 60, 90 days).
    • Runway gauge card with finite countdown or positive cash flow indicator.
    • Risk badges (LOW, MEDIUM, HIGH, CRITICAL) with localized date formatting.
    • Claymorphism loading skeleton & error retry handling.

2. What-if Financial Simulation Sandbox (/simulations)

  • Backend:
    • Discrete-event simulation over a 1–24 month horizon.
    • Support for custom recurring & one-time perturbations (income & expense shifts).
    • First-month deficit detection & saving goal collision evaluation.
    • Built-in scenario presets (New Job, Major Purchase, Inflation Surge, Aggressive Saving).
  • Frontend:
    • 1-click preset loader and interactive month duration slider.
    • Custom cash flow adjustment builder with real-time currency formatting.
    • Comparative trajectory breakdown (Baseline vs. Simulated) and goal delay alerts.

3. Multi-dimensional Anomaly Detection (/anomalies)

  • Backend:
    • Modified Z-Score using Median Absolute Deviation (MAD): $$M_i = \frac{0.6745 \cdot |x_i - \tilde{x}|}{\text{MAD}}$$
    • Multi-factor evaluation: Velocity bursts ($\ge 3$ txns / 20 min), off-peak transactions (02:00–05:00 UTC+7), and wallet balance ratio triggers.
    • Integration with NotificationService for real-time alerts.
  • Frontend:
    • Pre-purchase interactive transaction evaluator.
    • Flagged history cards with severity badges (CRITICAL, HIGH, ELEVATED) and tagged reason codes.

4. Auto Subscription Discovery (/subscriptions)

  • Backend:
    • Merchant token normalization and string cleaning.
    • Periodic regularity autocorrelation scoring ($R \ge 0.75$).
    • Price drift detection ($>3%$ increase between billing cycles).
    • 1-click conversion endpoint creating active tracked Reminder entries.
  • Frontend:
    • Discovered subscription cards with frequency badges (Monthly, Weekly, Yearly).
    • Amber warning banners for detected subscription price hikes.
    • 1-click "Add to Reminders" conversion action flow.

5. Hybrid NL to Deterministic DSL Query Engine (/query)

  • Backend:
    • Vietnamese natural language tokenizer and slot extractor.
    • Compiler generating type-safe Abstract Syntax Trees (AST).
    • Parameterized database aggregation executor (preventing raw SQL injection risks).
  • Frontend:
    • Natural language input bar with quick prompt chips.
    • AST filter inspector tags.
    • Verifiable summary card, category breakdown groups, and detailed matching transaction list.
Edited Aug 19, 2026 by ThinhNC

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b feat/advanced-financial-capabilities-suite origin/feat/advanced-financial-capabilities-suite

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/develop
git merge --no-ff feat/advanced-financial-capabilities-suite

Step 4. Push the result of the merge to GitLab

git push origin develop

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 0
  • Commits 1
  • Changes 43
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: ThinhNC/finwise-miniapp-be!29

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.