Business Flow Charts, Entity Relations, and Technical Architecture
The ECL Calculator is a comprehensive web application designed to calculate Expected Credit Loss (ECL) in compliance with RBI guidelines for Indian banks. The system provides a dual-interface approach with both traditional Flask-rendered pages and a modern React frontend.
Primary Entities:
Supporting Entities:
| Table | Primary Key | Foreign Keys | Unique Constraints |
|---|---|---|---|
| User | id | company_id → Company(id) | username, email |
| Company | id | - | name |
| ECLProcess | id | user_id → User(id), company_id → Company(id), template_id → Template(id) | - |
| ProcessStep | id | ecl_process_id → ECLProcess(id) | - |
| DataFile | id | ecl_process_id → ECLProcess(id) | - |
Description: Authenticate user and create session
Request Body:
{
"email": "user@example.com",
"password": "userpassword"
}
Response:
{
"success": true,
"user": {
"id": 1,
"username": "john_doe",
"email": "user@example.com",
"is_admin": false,
"company_id": 1
}
}
Description: End user session and logout
Response:
{
"success": true,
"message": "Logged out successfully"
}
Description: Get current authenticated user information
Response:
{
"authenticated": true,
"user": {
"id": 1,
"username": "john_doe",
"email": "user@example.com",
"is_admin": false,
"company_id": 1
}
}
Description: Get list of ECL processes for current user's company
Response:
{
"processes": [
{
"id": 1,
"name": "Q1 2024 ECL Calculation",
"status": "completed",
"start_time": "2024-01-15T10:00:00Z",
"end_time": "2024-01-15T10:30:00Z",
"user_id": 1,
"company_id": 1
}
]
}
Description: Create new ECL process
Request Body:
{
"name": "Q2 2024 ECL Calculation",
"template_id": null
}
Description: Upload data files for ECL process
Request: Multipart form data with CSV files
Description: Start ECL calculation process
Response:
{
"success": true,
"message": "ECL calculation started",
"process_id": 1
}
Description: Get current status of ECL process
Response:
{
"process_id": 1,
"status": "running",
"current_step": "PD Calculation",
"progress": 60,
"steps": [
{
"name": "Data Validation",
"status": "completed",
"start_time": "2024-01-15T10:00:00Z",
"end_time": "2024-01-15T10:05:00Z"
}
]
}
Description: Get list of all users (admin only)
Description: Create new user (admin only)
Description: Update user information (admin only)
Description: Get list of all companies (admin only)
Description: Get audit logs with filtering options (admin only)
ecl-calculator/
├── main.py # Application entry point
├── app.py # Flask app configuration and initialization
├── config.py # Configuration settings
├── models.py # SQLAlchemy database models
├── auth.py # Authentication blueprint
├── admin.py # Admin management blueprint
├── ecl_engine.py # ECL calculation engine
├── templates.py # Template management blueprint
├── reports.py # Reports generation blueprint
├── api.py # REST API endpoints
├── utils.py # Utility functions and helpers
├── create_demo_admin.py # Demo user creation script
├── requirements.txt # Python dependencies
├── package.json # Node.js dependencies
├── static/ # Static files (CSS, JS, images)
│ ├── css/
│ ├── js/
│ └── images/
├── templates/ # Jinja2 HTML templates
├── uploads/ # File upload directory
├── react-ecl-calculator/ # React frontend application
│ ├── src/
│ │ ├── components/
│ │ ├── contexts/
│ │ ├── services/
│ │ └── config/
│ ├── public/
│ └── build/
└── kubernetes/ # Kubernetes deployment manifests
Authentication & Authorization:
Data Protection:
Session Security:
| Metric | Target | Measurement |
|---|---|---|
| Page Load Time | < 3 seconds | First Contentful Paint |
| API Response Time | < 500ms | 95th percentile |
| ECL Processing Time | < 5 minutes per 10,000 loans | End-to-end calculation |
| Database Query Time | < 100ms | Average response time |
| File Upload Speed | > 10MB/minute | Upload throughput |
| Concurrent Users | 100+ simultaneous | Load testing results |