feat(reports): add financial reports and analytics
Summary
Adds authenticated Financial Reports & Analytics capabilities, providing consolidated insights from wallets, transactions, budgets, and saving goals.
Changes
- Added financial overview reporting with:
- Income, expenses, and net cash flow
- Current wallet balances
- Savings rate and expense-to-income ratio
- Budget and saving-goal summaries
- Added cash-flow time series with hourly, daily, weekly, monthly, and yearly granularity.
- Added spending breakdown by category.
- Added budget performance and utilization reporting.
- Added preset and custom reporting periods with timezone support.
- Added optional wallet and currency filters.
- Ensured monetary values are aggregated separately by currency.
- Added
currencyto budgets and restricted budget usage calculations to transactions using the same currency. - Updated Swagger documentation and project agent documentation.
New Endpoints
GET /api/v1/reports/overviewGET /api/v1/reports/cash-flowGET /api/v1/reports/spending-by-categoryGET /api/v1/reports/budget-performance
Database Changes
Added the migration:
20260803120000_add_budget_currency
The migration:
- Adds
Budget.currencywithVNDas the default for existing records. - Adds an index for budget reports filtered by user, currency, and date range.
- Has not been applied to the database yet.
Validation
pnpm exec prisma validatepnpm run prisma:generatepnpm build- Report validation and date-bucket smoke checks
- Multi-currency aggregation smoke checks
- Swagger JSON and component-reference checks
git diff --check
The repository currently has no automated test suite or active ESLint configuration.