Cosmic Module
O
Qubits of DPK
March 23, 2026
Core Open Source
fineract-shares
— Full Codebase Explanation
Apache Fineract supports not only loans and savings but also
What This Module Is (Big Picture)
The shares module manages equity ownership in the financial institution.
Many microfinance systems operate as:
- cooperatives
- member-owned financial institutions
- credit unions
In these systems, customers can buy shares in the institution.
This module manages:
- share accounts
- share purchases
- share redemptions
- dividend calculations
Layman
Imagine joining a cooperative bank.
Instead of only saving money, you can buy ownership shares in the bank.
Example:
- Customer buys 100 shares
- Each share is worth ₹100
- Customer owns ₹10,000 equity in the institution
The fineract-shares module manages this ownership system.
Where the Code Lives
Key Package 1:
org.apache.fineract.portfolio.shareaccounts
This package contains the core share account domain logic.
The Main Entity:
ShareAccount.java
Path
java
QUBITS OF DPK
This class represents a share account owned by a client or group.
Each share account tracks the ownership stake of a customer.
Key fields on
ShareAccount
Key methods inside
ShareAccount.java
java
QUBITS OF DPK
These methods represent:
- purchasing shares
- redeeming shares
- calculating total share value
Share Account Lifecycle
java
QUBITS OF DPK
Customers may buy or redeem shares during the lifecycle.
DTO Layer:
ShareAccountData.java
Path
java
QUBITS OF DPK
This DTO represents share account data returned through APIs.
Key fields
plain text
QUBITS OF DPK
This allows the UI to display:
- total shares owned
- share value
- share transaction history
API Layer
ShareAccountsApiResource.java
Path
java
QUBITS OF DPK
This REST controller exposes share account operations.
Key endpoints
java
QUBITS OF DPK
These APIs allow:
- creating share accounts
- approving accounts
- purchasing shares
- redeeming shares
- closing accounts
Read Services
ShareAccountReadPlatformService
Paths
java
QUBITS OF DPK
This service retrieves share account information.
Key read operations
java
QUBITS OF DPK
These queries return:
- share account details
- share ownership information
- share transaction history
Write Services
ShareAccountWritePlatformService
Paths
java
QUBITS OF DPK
Handles changes to share accounts.
Key write operations
java
QUBITS OF DPK
These represent ownership transactions.
Dividend Calculation
Shareholders may receive dividends based on profits.
Example simplified logic:
java
QUBITS OF DPK
Example:
- dividend per share = ₹10
- shares owned = 100
Dividend earned = ₹1000
Command Handlers
Path
java
QUBITS OF DPK
Key handlers include
java
QUBITS OF DPK
Each handler processes a specific share account command.
Repository and Data Access Layer
Exceptions
These prevent invalid share operations.
How It All Connects (Full Flow)
Example: Customer purchases shares
java
QUBITS OF DPK
Why This Module Matters
The share module integrates with several systems.
Examples:
- fineract-portfolio → links shares to clients
- fineract-accounting → records equity transactions
- fineract-reporting → calculates shareholder distributions
One-Sentence Summary
fineract-shares manages ownership shares in the financial institution, allowing clients to purchase, redeem, and track equity investments.