Overview
Wallets in FinAI represent different sources of money in your financial life. Each wallet maintains its own balance and can be used for income, expenses, or transfers between wallets.Database Schema
TheWallet model (located in app/models.py:50) stores wallet information:
Wallet Types
FinAI supports various wallet types to match real-world money sources:Cash
Physical cash for daily transactions
Bank Account
Traditional savings and checking accounts
E-Wallet
Digital wallets like Momo, ZaloPay, VNPay
Managing Wallets
View All Wallets
Access your wallets through the API endpoint:Response format (from
app/routes/foundation.py:16):Create a New Wallet
Add a new wallet to your account:
Wallet IDs are auto-generated using UUID (
app/routes/foundation.py:22). The system creates an 8-character unique identifier.Balance Management
Wallet balances are automatically updated when you create, edit, or delete transactions. The system handles three transaction types:Income Transactions
When you record income (app/routes/transaction.py:71):
Expense Transactions
When you record an expense (app/routes/transaction.py:68-69):
Transfer Transactions
When transferring between wallets (app/routes/transaction.py:72-75):
Transfers are NOT counted as expenses in reports. The AI chatbot is specifically trained to exclude transfers when calculating total spending (
app/ai_service.py:94-97).Multi-Wallet Workflows
Scenario: Managing Daily Cash and Savings
Scenario: Managing Daily Cash and Savings
- Create a “Cash” wallet for daily expenses
- Create a “Bank Savings” wallet for long-term money
- When you spend cash, record it as an expense from the Cash wallet
- When you deposit money, create a transfer transaction from Cash to Bank Savings
- View your total balance across all wallets in the dashboard
Scenario: Tracking E-Wallet Promotions
Scenario: Tracking E-Wallet Promotions
- Create separate wallets for Momo, ZaloPay, and ShopeePay
- Track which e-wallet gives you the best rewards
- Use the Reports feature to analyze spending by wallet
- Make informed decisions about which e-wallet to prioritize
Security Considerations
All wallet operations require authentication (@api_login_required decorator in app/routes/foundation.py:11). Users can only access and modify their own wallets through the user_id foreign key constraint.
Related Features
- Transactions - Record income, expenses, and transfers
- Reports - Analyze spending patterns by wallet
- Budgets - Set spending limits across all wallets
