Cosmic Module

O

Qubits of DPK

March 23, 2026

Core Open Source

What This Module Is (Big Picture)

The progressive loan module extends the standard loan module.
Traditional loans:
  • fixed repayment schedule
  • equal installments
  • schedule generated once
Progressive loans:
  • repayment schedule changes dynamically
  • interest recalculated after each repayment
  • remaining installments adjusted
Layman
A borrower may repay:
Month 1 → ₹1200
Month 2 → ₹800
Month 3 → ₹1500
Instead of fixed EMIs, the system recalculates remaining installments dynamically.

Where the Code Lives

Key Package

org.apache.fineract.portfolio.loanaccount.progressive
This package implements the dynamic loan schedule engine.
Responsibilities:
  • recalculating loan schedules
  • adjusting installments
  • computing interest after repayments

Core Domain Concept: Progressive Loan Schedule

The progressive loan schedule recalculates remaining installments after each repayment.
Example
Loan Amount = ₹10,000
Interest = 12%
Tenure = 10 months
Normal loan
Month 1 → ₹1,000
Month 2 → ₹1,000
Month 3 → ₹1,000
Progressive loan
Month 1 → ₹1,200
Month 2 → ₹850
Month 3 → recalculated

Key Class Example

Path
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/progressive/domain/ProgressiveLoanScheduleGenerator.java
This class generates repayment schedules dynamically.
Example simplified structure
java
QUBITS OF DPK
1public class ProgressiveLoanScheduleGenerator {
2
3    public List<Installment> generateSchedule(BigDecimal principal,
4                                              BigDecimal interestRate,
5                                              int installments) {
6
7        List<Installment> schedule = new ArrayList<>();
8
9        BigDecimal remainingPrincipal = principal;
10
11        for (int i = 1; i <= installments; i++) {
12
13            BigDecimal interest = remainingPrincipal
14                    .multiply(interestRate)
15                    .divide(BigDecimal.valueOf(100));
16
17            BigDecimal installmentAmount = principal
18                    .divide(BigDecimal.valueOf(installments));
19
20            Installment installment =
21                    new Installment(i, installmentAmount, interest);
22
23            schedule.add(installment);
24
25            remainingPrincipal =
26                    remainingPrincipal.subtract(installmentAmount);
27        }
28
29        return schedule;
30    }
31}

Technical Explanation of the Code

The schedule generator:
  1. #
    starts with the original loan principal
  2. #
    calculates interest on remaining principal
  3. #
    divides principal into installments
  4. #
    updates remaining principal after each installment
  5. #
    builds the installment schedule
This allows declining balance interest calculations.

Layman Explanation of the Code

Imagine someone borrows ₹10,000.
Each month:
  1. #
    system calculates interest on remaining balance
  2. #
    borrower pays part of the principal
  3. #
    next month’s interest becomes smaller
Example
Month 1
Principal = 10,000
Interest = 1,000
Month 2
Principal = 9,000
Interest = 900
Interest decreases as principal decreases.

Repayment Processing Example

When a borrower makes a repayment:
java
QUBITS OF DPK
1public void processRepayment(BigDecimal paymentAmount) {
2
3    this.outstandingBalance =
4            this.outstandingBalance.subtract(paymentAmount);
5
6    recalculateRemainingSchedule();
7}

Technical Explanation

The repayment process:
  1. #
    subtracts payment from outstanding balance
  2. #
    recalculates remaining repayment schedule
  3. #
    updates loan schedule records

Layman Explanation

When a borrower pays money:
  • the system reduces remaining loan balance
  • recalculates future installments
  • updates repayment plan

API Layer

Progressive loans use the same loan APIs.
Examples
java
QUBITS OF DPK
1POST /v1/loans
2POST /v1/loans/{loanId}?command=approve
3POST /v1/loans/{loanId}?command=disburse
4POST /v1/loans/{loanId}/repayments
However, when repayments happen, the progressive schedule engine runs automatically.

Command Handlers

Important handlers include
  • CreateProgressiveLoanCommandHandler
  • RepaymentCommandHandler
  • RecalculateScheduleCommandHandler
Each handler processes a specific progressive loan operation.

Repository Layer

Exceptions

How It All Connects (Full Flow)

Example: borrower makes repayment
java
QUBITS OF DPK
1Mobile App
2POST repayment
34LoansApiResource
56CommandProcessingService
78RepaymentCommandHandler
910LoanWritePlatformService
1112ProgressiveLoanScheduleGenerator
13    → recalculates installments
14    → adjusts interest
1516Database updated
1718Updated schedule returned

Why This Module Matters

Progressive loans allow institutions to support:
  • irregular borrower income
  • flexible repayments
  • dynamic interest calculations
This is extremely important in microfinance environments.

One-Sentence Summary

fineract-progressive-loan extends the loan system to support dynamic repayment schedules where installments and interest are recalculated after each repayment.