1. Use Case Diagram (UCD)
Illustrates the interactions between different users (Actors) and the system features.
flowchart LR
%% Actors
Admin((Admin / Manager))
Officer((Field Officer))
Client((Client))
%% Use Cases
subgraph LMS [Loan Management System]
UC1([Client KYC & Registration])
UC2([CRIB Evaluation])
UC3([Approve / Reject Loan])
UC4([Tokenize Card])
UC5([Auto-Charge Payments])
UC6([Collect via Lumnix Pay NFC])
UC7([Calculate Penalties])
UC8([View Defaulters Report])
end
Admin --> UC1
Admin --> UC2
Admin --> UC3
Admin --> UC7
Admin --> UC8
Client --> UC4
Client --> UC5
Officer --> UC6
2. Data Flow Diagram (DFD - Level 1)
Shows how data moves through the system, from input to data storage and reporting.
%%{init: {"flowchart": {"nodeSpacing": 60, "rankSpacing": 60}}}%%
flowchart TD
classDef external fill:#fce4ec,stroke:#c2185b,stroke-width:2px,color:#000
classDef process fill:#e3f2fd,stroke:#1565c0,stroke-width:2px,color:#000
classDef datastore fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px,color:#000
C[/"Client"/]:::external
CRIB[/"CRIB Document"/]:::external
PG[/"Payment Gateway"/]:::external
P1(("1.0
Registration")):::process
P2(("2.0
Loan Processing")):::process
P3(("3.0
Collections")):::process
P4(("4.0
Arrears Engine")):::process
DB1[("Client DB")]:::datastore
DB2[("Loan & Assets DB")]:::datastore
DB3[("Payments DB")]:::datastore
C -- "KYC Data" ---> P1
P1 -- "Store Profile" ---> DB1
CRIB -- "Upload / API" ---> P2
DB1 -. "Client History" .-> P2
P2 -- "Disbursement" ---> DB2
C -- "Card Token" ---> P3
P3 -- "Auto Charge Request" ---> PG
PG -- "Success/Fail" ---> P3
P3 -- "Transaction Log" ---> DB3
DB2 -. "Check Due Dates" .-> P4
P4 -- "Update Late Fees" ---> DB2
3. Entity Relationship Diagram (ERD)
Defines the underlying database structure and how different data tables relate to each other.
erDiagram
CLIENT ||--o{ LOAN : applies_for
CLIENT ||--o{ GUARANTOR : provides
LOAN ||--o{ COLLATERAL : secured_by
LOAN ||--o{ PAYMENT : receives
LOAN ||--o{ PENALTY : incurs
CLIENT {
uuid client_id PK
string name
string nic
string address
string phone
}
LOAN {
uuid loan_id PK
uuid client_id FK
decimal amount
decimal interest_rate
int duration_months
string status
}
GUARANTOR {
uuid guarantor_id PK
uuid client_id FK
string name
string nic
string phone
}
COLLATERAL {
uuid collateral_id PK
uuid loan_id FK
string type
decimal estimated_value
string document_url
}
PAYMENT {
uuid payment_id PK
uuid loan_id FK
decimal amount_paid
date payment_date
string method
}
PENALTY {
uuid penalty_id PK
uuid loan_id FK
decimal penalty_amount
date applied_date
boolean is_paid
}
4. Activity Diagram (Process Flow)
Maps out the complete lifecycle of a single loan from application to final settlement.
stateDiagram-v2
[*] --> Client_Onboarding
Client_Onboarding --> Collateral_Check
Collateral_Check --> CRIB_Evaluation
CRIB_Evaluation --> Loan_Decision
Loan_Decision --> Rejected : High Risk / Bad CRIB
Rejected --> [*]
Loan_Decision --> Approved : Acceptable Risk
Approved --> Agreement_Signing
Agreement_Signing --> Disbursement
Disbursement --> Collection_Phase
state Collection_Phase {
[*] --> Check_Due_Date
Check_Due_Date --> Auto_Charge : Gateway Token
Check_Due_Date --> Lumnix_Pay : NFC/QR Collection
Check_Due_Date --> Manual_Cash : Counter
}
Collection_Phase --> Arrears_Check
Arrears_Check --> Add_Penalty : Grace Period Exceeded
Add_Penalty --> Collection_Phase
Arrears_Check --> Settlement : Fully Paid
Settlement --> Release_Collateral
Release_Collateral --> [*]