# sharma2206/mis-report architecture

> Architecture diagram of the GitHub repository sharma2206/mis-report, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sharma2206/mis-report
- Repository: https://github.com/sharma2206/mis-report

## Overview

This Laravel application accepts branch- and date-specific CSV uploads, imports bill, cashier-collection, and (for Chromepet) package-consumption data, then generates a management information system (MIS) report for JSON display or Excel export. The principal flow is routed through the MIS API controller, which coordinates CSV processing and report generation. Report calculations query the imported records and apply branch-specific adjustments. The source excerpts show the controller, processing, and report layers; several import, validation, and export relationships are supported by the source index rather than full excerpts.

Main entry points: [`app/Services/CsvProcessingService.php`](https://github.com/sharma2206/mis-report/blob/main/app/Services/CsvProcessingService.php) (CSV processing), [`app/Http/Controllers/Api/MISController.php`](https://github.com/sharma2206/mis-report/blob/main/app/Http/Controllers/Api/MISController.php) (MIS controller), [`app/Services/MISService.php`](https://github.com/sharma2206/mis-report/blob/main/app/Services/MISService.php) (MIS calculations), [`app/Models/BillItem.php`](https://github.com/sharma2206/mis-report/blob/main/app/Models/BillItem.php) (Bill records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_routes["API routes<br/>[api.php]"]
  node_controller["MIS controller<br/>[MISController.php]"]
  node_upload_validation["Upload validation"]
  node_report_validation["Report validation<br/>[MISRequest.php]"]
  node_branch["Branch rules<br/>[Branch.php]"]
end

subgraph group_ingestion["CSV ingestion"]
  node_csv_service["CSV processing"]
  node_bill_import["Bill import<br/>[BillItemImport.php]"]
  node_cashier_import["Cashier import"]
  node_package_import["Package import"]
end

subgraph group_reporting["MIS reporting"]
  node_mis_service["MIS calculations<br/>[MISService.php]"]
  node_excel_export["Excel export<br/>[MISExport.php]"]
end

subgraph group_records["Report records"]
  node_bill_records["Bill records<br/>[BillItem.php]"]
  node_cashier_records["Cashier records"]
  node_package_records["Package records"]
end

node_user(("MIS user"))
node_database[("Application database")]

node_user -->|"calls API"| node_routes
node_routes -->|"routes to"| node_controller
node_controller -->|"validates upload"| node_upload_validation
node_controller -->|"validates report"| node_report_validation
node_upload_validation -->|"uses branch"| node_branch
node_report_validation -->|"uses branch"| node_branch
node_controller -->|"processes files"| node_csv_service
node_controller -->|"generates report"| node_mis_service
node_controller -->|"exports report"| node_excel_export
node_csv_service -->|"imports bills"| node_bill_import
node_csv_service -->|"imports collections"| node_cashier_import
node_csv_service -->|"imports packages"| node_package_import
node_bill_import -->|"creates records"| node_bill_records
node_cashier_import -->|"creates records"| node_cashier_records
node_package_import -->|"creates records"| node_package_records
node_mis_service -->|"queries records"| node_bill_records
node_mis_service -->|"queries records"| node_cashier_records
node_mis_service -->|"queries records"| node_package_records
node_csv_service -->|"deletes prior data"| node_bill_records
node_csv_service -->|"deletes prior data"| node_cashier_records
node_csv_service -->|"deletes prior data"| node_package_records
node_bill_records -.->|"persists records"| node_database
node_cashier_records -.->|"persists records"| node_database
node_package_records -.->|"persists records"| node_database

click node_routes "https://github.com/sharma2206/mis-report/blob/main/routes/api.php"
click node_controller "https://github.com/sharma2206/mis-report/blob/main/app/Http/Controllers/Api/MISController.php"
click node_upload_validation "https://github.com/sharma2206/mis-report/blob/main/app/Http/Requests/MISUploadRequest.php"
click node_report_validation "https://github.com/sharma2206/mis-report/blob/main/app/Http/Requests/MISRequest.php"
click node_branch "https://github.com/sharma2206/mis-report/blob/main/app/Enums/Branch.php"
click node_csv_service "https://github.com/sharma2206/mis-report/blob/main/app/Services/CsvProcessingService.php"
click node_bill_import "https://github.com/sharma2206/mis-report/blob/main/app/Imports/BillItemImport.php"
click node_cashier_import "https://github.com/sharma2206/mis-report/blob/main/app/Imports/CashierCollectionImport.php"
click node_package_import "https://github.com/sharma2206/mis-report/blob/main/app/Imports/PackageConsumptionImport.php"
click node_mis_service "https://github.com/sharma2206/mis-report/blob/main/app/Services/MISService.php"
click node_excel_export "https://github.com/sharma2206/mis-report/blob/main/app/Exports/MISExport.php"
click node_bill_records "https://github.com/sharma2206/mis-report/blob/main/app/Models/BillItem.php"
click node_cashier_records "https://github.com/sharma2206/mis-report/blob/main/app/Models/CashierCollection.php"
click node_package_records "https://github.com/sharma2206/mis-report/blob/main/app/Models/PackageConsumption.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routes,node_controller,node_upload_validation,node_report_validation,node_branch,node_user toneBlue
class node_csv_service,node_bill_import,node_cashier_import,node_package_import,node_database toneAmber
class node_mis_service,node_excel_export toneMint
class node_bill_records,node_cashier_records,node_package_records toneRose
```

## Components

### API entry

- [API routes](https://github.com/sharma2206/mis-report/blob/main/routes/api.php): `routes/api.php`
- [MIS controller](https://github.com/sharma2206/mis-report/blob/main/app/Http/Controllers/Api/MISController.php): `app/Http/Controllers/Api/MISController.php`
- [Upload validation](https://github.com/sharma2206/mis-report/blob/main/app/Http/Requests/MISUploadRequest.php): `app/Http/Requests/MISUploadRequest.php`
- [Report validation](https://github.com/sharma2206/mis-report/blob/main/app/Http/Requests/MISRequest.php): `app/Http/Requests/MISRequest.php`
- [Branch rules](https://github.com/sharma2206/mis-report/blob/main/app/Enums/Branch.php): `app/Enums/Branch.php`

### CSV ingestion

- [CSV processing](https://github.com/sharma2206/mis-report/blob/main/app/Services/CsvProcessingService.php): `app/Services/CsvProcessingService.php`
- [Bill import](https://github.com/sharma2206/mis-report/blob/main/app/Imports/BillItemImport.php): `app/Imports/BillItemImport.php`
- [Cashier import](https://github.com/sharma2206/mis-report/blob/main/app/Imports/CashierCollectionImport.php): `app/Imports/CashierCollectionImport.php`
- [Package import](https://github.com/sharma2206/mis-report/blob/main/app/Imports/PackageConsumptionImport.php): `app/Imports/PackageConsumptionImport.php`

### MIS reporting

- [MIS calculations](https://github.com/sharma2206/mis-report/blob/main/app/Services/MISService.php): `app/Services/MISService.php`
- [Excel export](https://github.com/sharma2206/mis-report/blob/main/app/Exports/MISExport.php): `app/Exports/MISExport.php`

### Report records

- [Bill records](https://github.com/sharma2206/mis-report/blob/main/app/Models/BillItem.php): `app/Models/BillItem.php`
- [Cashier records](https://github.com/sharma2206/mis-report/blob/main/app/Models/CashierCollection.php): `app/Models/CashierCollection.php`
- [Package records](https://github.com/sharma2206/mis-report/blob/main/app/Models/PackageConsumption.php): `app/Models/PackageConsumption.php`

### Other components

- **MIS user**
- **Application database**

## Connections

- MIS user → API routes: calls API
- API routes → MIS controller: routes to (evidence: `routes/api.php`)
- MIS controller → Upload validation: validates upload (evidence: `app/Http/Controllers/Api/MISController.php`)
- MIS controller → Report validation: validates report (evidence: `app/Http/Controllers/Api/MISController.php`)
- Upload validation → Branch rules: uses branch (evidence: `app/Http/Requests/MISUploadRequest.php`)
- Report validation → Branch rules: uses branch (evidence: `app/Http/Requests/MISRequest.php`)
- MIS controller → CSV processing: processes files (evidence: `app/Http/Controllers/Api/MISController.php`)
- MIS controller → MIS calculations: generates report (evidence: `app/Http/Controllers/Api/MISController.php`)
- MIS controller → Excel export: exports report (evidence: `app/Http/Controllers/Api/MISController.php`)
- CSV processing → Bill import: imports bills (evidence: `app/Services/CsvProcessingService.php`)
- CSV processing → Cashier import: imports collections (evidence: `app/Services/CsvProcessingService.php`)
- CSV processing → Package import: imports packages (evidence: `app/Services/CsvProcessingService.php`)
- Bill import → Bill records: creates records (evidence: `app/Imports/BillItemImport.php`)
- Cashier import → Cashier records: creates records (evidence: `app/Imports/CashierCollectionImport.php`)
- Package import → Package records: creates records (evidence: `app/Imports/PackageConsumptionImport.php`)
- MIS calculations → Bill records: queries records (evidence: `app/Services/MISService.php`)
- MIS calculations → Cashier records: queries records (evidence: `app/Services/MISService.php`)
- MIS calculations → Package records: queries records (evidence: `app/Services/MISService.php`)
- CSV processing → Bill records: deletes prior data (evidence: `app/Services/CsvProcessingService.php`)
- CSV processing → Cashier records: deletes prior data (evidence: `app/Services/CsvProcessingService.php`)
- CSV processing → Package records: deletes prior data (evidence: `app/Services/CsvProcessingService.php`)
- Bill records → Application database: persists records
- Cashier records → Application database: persists records
- Package records → Application database: persists records
