Skip to content

feat: implement EMI (Equated Monthly Installment) management feature … - #745

Closed
OnoPUNPUN wants to merge 1 commit into
flow-mn:developfrom
OnoPUNPUN:feat/add-emi-tracking
Closed

feat: implement EMI (Equated Monthly Installment) management feature …#745
OnoPUNPUN wants to merge 1 commit into
flow-mn:developfrom
OnoPUNPUN:feat/add-emi-tracking

Conversation

@OnoPUNPUN

Copy link
Copy Markdown

EMI (Equated Monthly Installment) Tracking

This PR introduces EMI (Equated Monthly Installment) Tracking to allow users to create, manage, and track installment-based payments such as loans, device financing, and vehicle purchases within Flow.

Overview

The feature provides a dedicated EMI tracking system that integrates with Flow's existing transaction architecture. Users can monitor payment progress, track remaining balances, and automatically generate expense transactions when installments are paid.


Feature Workflow

Adding an EMI Tracker

A new EMI Tracker entry is available under the Profile section.

Users can create an EMI by providing:

  • Title
  • Description (optional)
  • Total amount
  • Installment amount
  • Number of installments
  • Start date
  • Account
  • Category

Upon creation, a dedicated Emi tracking record is stored.

Tracking Progress

The EMI List screen displays all trackers.

Features include:

  • Active EMIs displayed before completed EMIs
  • Installment progress visualization
  • Remaining balance tracking
  • Paid and remaining installment counts

Paying Installments

The EMI Details page provides a Pay Installment action.

When an installment is paid:

  • paidInstallments is incremented
  • remainingInstallments is decremented
  • paidAmount is increased
  • remainingAmount is reduced
  • nextDueDate is advanced by one month
  • An expense transaction is automatically generated

Generated transactions are linked to the selected account and category.

To maintain the relationship between the transaction and the EMI tracker, transactions are associated using the EmiExtension mapping key:

@flow/emi-reference

These transactions behave exactly like normal expense transactions and are automatically included in:

  • Expense reports
  • Monthly summaries
  • Analytics
  • Charts

Payment History

The EMI Details page includes a payment history timeline.

Features include:

  • Automatic retrieval of all linked installment transactions
  • Navigation from payment history entries to transaction details

Completion Logic

An EMI is marked as completed when:

  • paidInstallments == totalInstallments

or

  • remainingAmount <= 0

Once completed:

  • Status is set to completed
  • nextDueDate is cleared
  • The Pay Installment action is disabled

Editing and Deletion

Editing allows modification of:

  • Title
  • Description
  • Account
  • Category

To preserve tracking integrity, payment-related values cannot be manually modified.

Deleting an EMI tracker removes only the tracking record.

Previously generated transactions remain intact and are not deleted.


Implementation Details

Entities and Schema

Added:

  • lib/entity/emi.dart
  • lib/entity/transaction/extensions/default/emi.dart

Registered EmiExtension inside ExtensionsWrapper.

Services

Added:

  • lib/services/emi.dart

EmiService encapsulates:

  • EMI CRUD operations
  • Installment payment logic
  • Transaction generation
  • Completion state management

Routing and Navigation

Added routes in:

  • lib/routes.dart

Integrated entry point into:

  • ProfileTab

UI

Added:

EMI List Page

  • Tracker overview dashboard
  • Progress indicators
  • Active/completed grouping

EMI Edit Page

  • Create and edit EMI forms
  • Account selection
  • Category selection

EMI Detail Page

  • EMI statistics
  • Progress tracking
  • Payment action
  • Payment history timeline

Localization

Added EMI-related localization keys to:

  • en.json

Synchronized localization keys across all supported language files to maintain translation integrity.


Scope Included

  • Create EMI
  • Edit EMI
  • Delete EMI
  • EMI List
  • EMI Details
  • Pay Installment
  • Auto-generated Expense Transactions
  • Payment History
  • Completion Tracking
  • Localization Support

Scope Excluded

  • Notifications
  • Interest calculations
  • Auto-pay
  • Bank integrations
  • Partial installment payments
  • Amortization schedules

@sadespresso

sadespresso commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the work here. I've reviewed it, and I'm going to close this one — not because of fixable details, but because I'm not convinced Flow needs an EMI feature at all in this shape. Reasoning below so it's not a black box.

Logic

As implemented, this isn't much different from a recurring transaction, which Flow already does. A fixed amount on a fixed interval for a fixed duration is a recurring transaction with an end date — wrapping that in a new entity doesn't earn its place.

If EMI is going to exist as its own thing, it has to tell me something recurring transactions can't. Real life EMI includes interest, so the flow should ask for the total payment and the interval/number of installments (like every month at the 7th), derive the schedule, and then surface what I actually want to know: how much of this am I paying in interest? What's the remaining principal? What does this loan cost me in total? That's the part with real potential — it's what would make BNPL or leasing worth modeling. Right now none of it is there.

UI

It's a separate page. That can work for something used rarely, but entering duration, number of installments, and per-installment amount as three flat fields isn't a flow — it's a form.

The new UI also doesn't follow how other pages render lists or "add" buttons, so it reads as bolted on.

Deleting

Deleting an EMI should remove all EMI-tagged transactions, or at least offer that option. Without it, the feature doesn't save meaningful work over entering the transactions manually — and manual entry has the advantage of reflecting what I actually paid.

Conclusion

To be clear about where this stands: I'm not looking to pursue EMI right now, so this isn't a "revise and resubmit." Even a version that added interest calculations and insights would need design discussion first, and I'd rather not have you spend time on a rework I can't commit to merging.

Thank you for trying to make Flow better. The branch is genuinely useful as-is for your own build, and I'd encourage you to keep running it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants