Calculator (Invoice Dashboard)
π Product Overviewβ
Invoice Dashboard 2.0 is a multi-tenant SaaS billing management system designed for Sumsub resellers and service providers.
Core Value Propositionβ
- Transparent Billing: Real-time visibility into every KYC/AML consumption with detailed breakdowns
- Multi-User Support: Role-based access control (Admin/User) with isolated data views
- Flexible Pricing: Different unit prices for the same service across different customers
- Automated Reporting: Monthly summaries with cost calculations and service breakdowns
- Audit-Ready: Complete dataθΏ½ζΊ― with timestamped records
π― Target Usersβ
| User Type | Use Case |
|---|---|
| Sumsub Resellers | Track consumption across multiple end customers with custom pricing |
| SaaS Providers | Manage service usage billing for B2B customers |
| Compliance Teams | Generate audit-ready billing reports for regulatory reviews |
β¨ Key Featuresβ
User & Permission Managementβ
- Multi-user system with unlimited accounts
- RBAC: Admin (full access) vs User (own data only)
- Secure password hashing (Werkzeug)
- 7-day session expiry with CSRF protection
Service & Pricing Managementβ
- Global service directory maintained by admins
- Flexible service assignment per customer
- Snapshot pricing: Historical records preserve original unit prices even after pricing changes
Data Import & Processingβ
- CSV file upload with drag-and-drop
- Auto-validation for service existence and user permissions
- Batch processing support (max 10MB files)
- Complete file upload history tracking
Automated Reportingβ
- Monthly aggregation with cost calculations
- Service-level breakdowns
- Quick filtering by year/month
- CSV export for further analysis
ποΈ Technical Architectureβ
| Layer | Technology |
|---|---|
| Frontend | Bootstrap 5 + Jinja2 |
| Backend | Flask 3.0+ |
| Database | SQLAlchemy + SQLite |
| Data Processing | Pandas |
| Web Server | Gunicorn + Nginx |
| Process Manager | PM2 |
Database Schemaβ
| Table | Purpose |
|---|---|
User | User accounts with role flags |
Service | Global service directory |
UserService | User-service assignments |
ServicePricing | Per-user pricing configurations |
UsageRecord | Individual usage entries with price snapshots |
MonthlySummary | Pre-aggregated monthly statistics |
UploadFile | File upload tracking |
π Quick Startβ
For Adminsβ
- Create global services in the Service Directory
- Create user accounts
- Assign services to each user
- Configure unit prices per user-service pair
- System ready for data ingestion
For End Usersβ
- Upload CSV files with columns:
serviceName,clientId,quantity,serviceTime - System auto-validates and processes data
- View monthly reports with cost breakdowns
- Export data for further analysis
π Security Featuresβ
- SQL Injection Protection: SQLAlchemy ORM with parameterized queries
- XSS Prevention: Jinja2 auto-escaping
- CSRF Protection: Flask session protection
- Data Isolation: Users can only access their own data
- Environment-Based Secrets: SECRET_KEY from environment variables
π Performance Metricsβ
| Operation | Latency |
|---|---|
| User Login | < 100ms |
| CSV Upload (1000 rows) | < 1s |
| Monthly Report Generation | < 500ms |
| Report Query | < 50ms |
π File Structureβ
calculator/
βββ invoice_dashboard/
β βββ app.py # Flask application
β βββ models.py # SQLAlchemy ORM models
β βββ routes_auth.py # Authentication routes
β βββ routes_dashboard.py # Dashboard routes
β βββ routes_upload.py # CSV upload routes
β βββ routes_reports.py # Report generation routes
β βββ templates/ # Jinja2 templates
βββ data/
β βββ input/ # Uploaded CSV files
β βββ output/ # Generated reports
βββ requirements.txt # Python dependencies
π Related Resourcesβ
- Source Code: Available in internal repository
- Deployment Guide: Contact Operations Team
- API Documentation: Coming Soon
Last Updated: 2026-05-02 | Version: 2.0 | Status: β Production Ready