Cosmic Module

O

Qubits of DPK

March 23, 2026

Core Open Source

What This Module Is (Big Picture)

The template module manages reusable document templates used by the banking system.
Banks frequently generate documents such as:
  • loan agreements
  • repayment schedules
  • customer letters
  • account statements
  • notification documents
Instead of manually creating these documents each time, the system uses templates with placeholders that are automatically filled with real data.

Layman Example

A bank generates a loan agreement document.
Instead of writing the document manually for every customer, the bank creates a template.
Example template:
plain text
QUBITS OF DPK
1Loan Agreement
2
3Customer Name: {{clientName}}
4Loan Amount: {{loanAmount}}
5Interest Rate: {{interestRate}}
6Loan Term: {{loanTerm}}
When a loan is created, the system replaces placeholders with real values.
Example generated document:
plain text
QUBITS OF DPK
1Loan Agreement
2
3Customer Name: John Doe
4Loan Amount: ₹10,000
5Interest Rate: 12%
6Loan Term: 12 months
The fineract-template module manages these templates.

Where the Code Lives

Key Package

org.apache.fineract.infrastructure.template
Responsibilities include:
  • storing templates
  • managing template metadata
  • processing placeholders
  • generating documents from templates

Core Domain Entity:

Template.java

Path
fineract-template/src/main/java/org/apache/fineract/infrastructure/template/domain/Template.java
This entity represents a reusable document template.

Key fields on

Template

Template Placeholders

Templates use placeholders to insert dynamic values.
Examples
During document generation, these placeholders are replaced with real data.

Example Template Processing Code

java
QUBITS OF DPK
1public String generateDocument(String templateText, Map<String, String> values) {
2
3    String result = templateText;
4
5    for (Map.Entry<String, String> entry : values.entrySet()) {
6
7        String placeholder = "{{" + entry.getKey() + "}}";
8        result = result.replace(placeholder, entry.getValue());
9    }
10
11    return result;
12}
This replaces placeholders in the template with real values.

API Layer

Main controller
TemplateApiResource
Example endpoints
plain text
QUBITS OF DPK
1GET  /v1/templates
2POST /v1/templates
3GET  /v1/templates/{templateId}
4PUT  /v1/templates/{templateId}
5DELETE /v1/templates/{templateId}
These APIs allow administrators to:
  • create templates
  • update templates
  • retrieve templates
  • delete templates

Read Services

Read services retrieve template definitions.
Examples include:
  • retrieving templates by entity type
  • retrieving template metadata
  • retrieving template content
These services are used during document generation.

Write Services

Write services manage template configuration.
Responsibilities include:
  • creating templates
  • updating template content
  • activating or deactivating templates
  • deleting templates

Repository Layer

Exceptions

These ensure template operations remain valid.

How It All Connects (Full Flow)

Example: Generating a loan agreement
java
QUBITS OF DPK
1Loan Service
2Loan approved
34Template Service
5Retrieve loan agreement template
67Template Processor
8Replace placeholders with loan data
910Generated Document
11Stored in document module
1213User downloads document

Why This Module Matters

Templates allow financial institutions to:
  • automate document generation
  • maintain consistent document formats
  • reduce manual paperwork
This is essential for loan contracts, compliance documents, and reporting.

One-Sentence Summary

fineract-template manages reusable document templates used to generate dynamic documents such as loan agreements and customer communications.