๐ฐ Finance & Budgeting Services
18 services covering expense tracking, budgeting, debt management, investments, forecasting, and financial calculators โ all with offline-first local persistence.
ServicePersistence (or extend CrudService) for JSON-serialized local storage. Data never leaves the device unless explicitly exported.
| Service | Purpose | Persistence |
|---|---|---|
| ExpenseTrackerService | Track income & expenses with categories, payment methods, analytics | ServicePersistence |
| BudgetPlannerService | Monthly budgets with category allocation and variance tracking | ServicePersistence |
| SavingsGoalService | Named savings goals with contributions and progress tracking | ServicePersistence |
| DebtPayoffService | Debt snowball/avalanche payoff planning | CrudService |
| NetWorthTrackerService | Asset & liability tracking with monthly snapshots | ServicePersistence |
| FireCalculatorService | Financial independence / retire early projections | Stateless |
| ExpenseForecastService | Spending anomaly detection and budget alerts | Stateless (reads expenses) |
| SubscriptionTrackerService | Recurring subscription management with renewal calendar | In-memory list |
| BillReminderService | Bill tracking with due dates, autopay, and paid status | CrudService |
| CompoundInterestService | Compound interest projections and Rule of 72 | Stateless |
| LoanCalculatorService | Amortization schedules with extra payment analysis | Stateless |
| MortgageCalculatorService | Mortgage-specific calculations (extends loan logic) | Stateless |
| TaxCalculatorService | US federal income tax with brackets and deductions | Stateless |
| SalaryCalculatorService | Gross-to-net salary breakdown with tax withholding | Stateless |
| InvoiceService | Invoice generation with line items, tax, and discount | Stateless |
| CurrencyConverterService | Multi-currency conversion with 30+ currencies | Stateless |
| TipCalculatorService | Tip and bill splitting | Stateless |
ExpenseTrackerService
The central expense tracking engine. Records income and expense transactions with categories, payment methods, tags, and notes. Provides daily summaries, category breakdowns, budget alerts, and streak tracking.
Key Types
enum ExpenseCategory { food, transport, housing, utilities, entertainment,
shopping, health, education, travel, income, other }
enum PaymentMethod { cash, credit, debit, bankTransfer, digital, other }
class BudgetConfig {
final double monthlyBudget; // Default: 3000.0
final Map<ExpenseCategory, double> categoryLimits;
final double alertThreshold; // 0.0โ1.0, default 0.8
final String currencySymbol;
}
class DailyExpenseSummary {
final DateTime date;
final double totalSpent;
final double totalIncome;
final int transactionCount;
final Map<ExpenseCategory, double> byCategory;
final Map<PaymentMethod, double> byPaymentMethod;
double get netFlow; // income - spending
}
Core Methods
| Method | Returns | Description |
|---|---|---|
addExpense(ExpenseEntry) | void | Record a new transaction (income or expense) |
removeExpense(String id) | bool | Delete a transaction by ID |
updateExpense(ExpenseEntry) | void | Replace an existing transaction |
getExpensesByDateRange(start, end) | List<ExpenseEntry> | Filter entries within a date window |
getDailySummary(DateTime) | DailyExpenseSummary | Aggregated daily spending breakdown |
getMonthlySummary(year, month) | MonthlySummary | Month totals with category and payment method splits |
updateBudget(BudgetConfig) | void | Set monthly budget and category limits |
getBudgetStatus() | BudgetStatus | Current spend vs budget with per-category progress |
BudgetPlannerService
Monthly budget allocation with category-level caps. Compares planned budgets against actual spending from ExpenseTrackerService to surface variances and savings rates.
Core Methods
| Method | Returns | Description |
|---|---|---|
setBudget(MonthlyBudget) | MonthlyBudget | Create or update a month's budget |
getOrCreateBudget(year, month) | MonthlyBudget | Retrieve existing or initialize from last month's template |
deleteBudget(year, month) | bool | Remove a monthly budget |
createEvenSplit(year, month, total) | MonthlyBudget | Auto-allocate total evenly across all categories |
getBudgetComparison(budget, expenses) | BudgetComparison | Planned vs actual with per-category variance |
getSavingsRate(expenses, year, month) | double | Savings rate = (income โ spending) / income |
SavingsGoalService
Named savings goals (vacation, emergency fund, etc.) with individual contribution tracking, progress percentages, and monthly savings insights.
Core Methods
| Method | Returns | Description |
|---|---|---|
addGoal({name, target, deadline?}) | SavingsGoal | Create a new goal. Validates name and target > 0 |
addContribution(goalId, amount, note?) | Contribution | Record money saved toward a goal |
removeGoal(String id) | bool | Delete a goal and all its contributions |
removeContribution(goalId, contribId) | bool | Remove a single contribution |
monthlySavings(year, month) | double | Total contributions for a given month |
getInsights() | SavingsInsights | Aggregate stats: total saved, goal count, completion % |
exportJson() | String | Full JSON export for backup |
DebtPayoffService
Debt management with payoff strategy simulation. Extends CrudService<DebtEntry> for CRUD operations and adds snowball/avalanche payoff planning.
Payoff Strategies
enum PayoffStrategy {
snowball, // Smallest balance first (behavioral motivation)
avalanche, // Highest interest rate first (mathematically optimal)
}
Core Methods
| Method | Returns | Description |
|---|---|---|
addDebt({name, balance, rate, minPayment}) | DebtEntry | Add a debt. Validates rate โฅ 0 and minPayment > 0 |
removeDebt(String id) | void | Remove a debt by ID |
computePlan(strategy, {extraPayment}) | PayoffPlan | Simulate month-by-month payoff with total interest and payoff date |
months (List of monthly snapshots), totalInterest, totalPaid, and payoffDate. Each monthly snapshot shows per-debt remaining balances and payments applied.
NetWorthTrackerService
Track assets and liabilities across accounts with monthly net worth snapshots, milestones, and category breakdowns.
Core Methods
| Method | Returns | Description |
|---|---|---|
addAccount({name, type, balance}) | NetWorthAccount | Add an asset or liability account |
archiveAccount(String id) | bool | Soft-delete an account (preserved in history) |
restoreAccount(String id) | bool | Unarchive a previously archived account |
updateBalance(id, newBalance) | void | Update an account's current balance |
takeSnapshot() | MonthlyNetWorth | Record current total for historical tracking |
getReport() | NetWorthReport | Full report with category breakdown and milestones |
FireCalculatorService
Financial Independence / Retire Early (FIRE) calculator. Projects portfolio growth over time and estimates the year you can retire based on savings rate, investment returns, and withdrawal strategy.
Core Methods
| Method | Returns | Description |
|---|---|---|
calculate({income, expenses, savings, returnRate, withdrawalRate, currentAge}) | FireResult | Full FIRE projection with yearly portfolio values |
savingsRateLabel(double rate) | String | Human-friendly label ("Excellent", "Good", etc.) |
FireResult
class FireResult {
final int yearsToFire; // Years until financial independence
final double fireNumber; // Target portfolio value
final double savingsRate; // Annual savings as % of income
final List<FireProjectionYear> projections; // Year-by-year portfolio growth
}
Withdrawal Strategies
// Pre-defined withdrawal rates
WithdrawalStrategy.traditional // 4% rule (Trinity Study)
WithdrawalStrategy.conservative // 3.5% (longer retirement horizon)
WithdrawalStrategy.lean // 3% (lean FIRE)
WithdrawalStrategy.fat // 4.5% (fat FIRE with margin)
ExpenseForecastService
Analyzes expense history to detect spending anomalies, identify recurring expenses, forecast upcoming costs, and generate budget alerts.
Core Methods
| Method | Returns | Description |
|---|---|---|
generateReport(expenses, budgetConfig) | ForecastReport | Complete forecast with anomalies, alerts, recurring items, and per-category projections |
ForecastReport Contents
class ForecastReport {
final List<CategoryForecast> forecasts; // Per-category projections
final List<SpendingAnomaly> anomalies; // Unusual spending spikes
final List<RecurringExpense> recurring; // Detected recurring charges
final List<BudgetAlert> alerts; // Budget threshold warnings
final double projectedMonthlyTotal;
}
SubscriptionTrackerService
Manage recurring subscriptions with billing cycle tracking, renewal calendars, and spending breakdowns by category.
Core Methods
| Method | Returns | Description |
|---|---|---|
add(SubscriptionEntry) | void | Add a subscription (throws on duplicate ID) |
update(id, SubscriptionEntry) | void | Update subscription details |
remove(String id) | void | Cancel/remove a subscription |
getSummary() | SubscriptionSummary | Total monthly/annual cost, count, category breakdown |
getUpcomingBillings(days) | List<BillingAlert> | Subscriptions renewing within N days |
getRenewalCalendar(month) | List<RenewalCalendarEntry> | Day-by-day renewal schedule for a month |
BillReminderService
Track bills with due dates, autopay status, and payment confirmation. Extends CrudService<BillEntry>.
Core Methods
| Method | Returns | Description |
|---|---|---|
addBill(BillEntry) | void | Add a new bill |
markPaid(String id) | void | Mark a bill as paid for the current cycle |
markUnpaid(String id) | void | Revert a bill to unpaid |
getSummary() | BillSummary | Upcoming, overdue, and total monthly bill obligations |
CompoundInterestService
Compound interest projections with configurable compounding frequencies. Stateless โ all methods are const-constructable and pure.
Compounding Frequencies
CompoundFrequency.annually // 1ร/year
CompoundFrequency.semiAnnually // 2ร/year
CompoundFrequency.quarterly // 4ร/year
CompoundFrequency.monthly // 12ร/year
CompoundFrequency.daily // 365ร/year
Core Methods
| Method | Returns | Description |
|---|---|---|
finalBalance({principal, rate, years, frequency, monthlyContrib}) | double | Final balance after compounding |
yearsToReach({principal, target, rate, frequency, monthlyContrib}) | int | Years needed to reach a target balance |
ruleOf72(double annualRate) | double | Approximate doubling time (72 / rate) |
getProjection({...}) | List<ProjectionPoint> | Year-by-year projection with principal vs interest split |
LoanCalculatorService
Loan amortization calculator with full payment schedules and extra-payment analysis. Shows interest savings from additional payments.
Core Methods
| Method | Returns | Description |
|---|---|---|
calculate({principal, annualRate, months}) | LoanResult | Monthly payment, total interest, amortization schedule |
withExtraPayment({..., extraMonthly}) | ExtraPaymentResult | Compares standard vs accelerated payoff โ months saved, interest saved |
LoanResult
class LoanResult {
final double monthlyPayment;
final double totalInterest;
final double totalPaid;
final List<AmortizationEntry> schedule; // Month-by-month principal/interest split
}
MortgageCalculatorService
Mortgage-specific calculator with property tax, PMI, HOA, and insurance factored into the monthly payment. Includes home affordability estimation.
Core Methods
| Method | Returns | Description |
|---|---|---|
calculate({price, downPayment, rate, years, tax?, insurance?, pmi?, hoa?}) | MortgageResult | Full monthly breakdown with PITI + HOA |
affordability({income, debts, rate, years}) | double | Maximum affordable home price (28/36 rule) |
TaxCalculatorService
US federal income tax calculator with 2024 tax brackets, standard/itemized deductions, and filing status support.
Filing Statuses
FilingStatus.single
FilingStatus.marriedJoint
FilingStatus.marriedSeparate
FilingStatus.headOfHousehold
Core Methods
| Method | Returns | Description |
|---|---|---|
calculate({income, filingStatus, deductions?}) | TaxResult | Tax owed, effective rate, marginal rate, bracket breakdown |
TaxResult
class TaxResult {
final double taxableIncome;
final double totalTax;
final double effectiveRate; // totalTax / grossIncome
final double marginalRate; // Top bracket rate
final List<BracketBreakdown> brackets; // Tax owed per bracket
}
SalaryCalculatorService
Gross-to-net salary calculator with federal tax withholding, FICA (Social Security + Medicare), and state tax estimation.
Core Methods
| Method | Returns | Description |
|---|---|---|
calculate({grossAnnual, filingStatus, stateRate?, preTaxDeductions?}) | SalaryResult | Net pay breakdown: federal, state, FICA, take-home per pay period |
SalaryResult
class SalaryResult {
final double grossAnnual;
final double federalTax;
final double stateTax;
final double socialSecurity;
final double medicare;
final double netAnnual;
final double netMonthly;
final double netBiweekly;
}
InvoiceService
Invoice calculation engine with line items, quantity pricing, tax rates, and discount application.
Core Methods
| Method | Returns | Description |
|---|---|---|
calculate({lineItems, taxRate?, discountPercent?}) | InvoiceResult | Subtotal, discount amount, tax amount, and grand total |
CurrencyConverterService
Offline currency converter with 30+ built-in exchange rates (pegged to USD). Rates are approximate โ intended for estimation, not trading.
Core Methods
| Method | Returns | Description |
|---|---|---|
convert(amount, from, to) | double | Convert between any two supported currencies |
getSupportedCurrencies() | List<CurrencyInfo> | All available currencies with name, symbol, and rate |
TipCalculatorService
Simple tip calculator with bill splitting. Calculates tip amount, total per person, and supports custom tip percentages.
Core Methods
| Method | Returns | Description |
|---|---|---|
calculate({billAmount, tipPercent, splitCount}) | TipResult | Tip amount, total, per-person share |
Service Relationships
The finance services form a connected ecosystem:
ExpenseTrackerService โโโ BudgetPlannerService (actual vs planned)
โ โ
โโโโ ExpenseForecastService (anomaly detection, projections)
โ
โโโโ SavingsGoalService (track money set aside)
โ
โโโโ FireCalculatorService (retirement projections)
โ
CompoundInterestService โโโโโโโ (investment growth math)
DebtPayoffService โโโโ LoanCalculatorService (shared amortization logic)
โ
MortgageCalculatorService (extends loan concepts)
SubscriptionTrackerService โโโ BillReminderService (recurring obligations)
TaxCalculatorService โโโ SalaryCalculatorService (tax brackets shared)
InvoiceService, CurrencyConverterService, TipCalculatorService (standalone utilities)
Last updated: April 2026 ยท GitHub