# imroznet/ahmad-solution-erp architecture

> Architecture diagram of the GitHub repository imroznet/ahmad-solution-erp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/imroznet/ahmad-solution-erp
- Repository: https://github.com/imroznet/ahmad-solution-erp

## Overview

This is Ahmad Solution Ltd.’s internal business-management system. Staff maintain company and party records, create and approve priced quotation revisions, then use accepted quotations to prepare delivery challans and commercial invoices; Mushak 6.3 tax documents and separate VDS/AIT records are handled as a distinct downstream capability. Controllers connect user actions to domain services and persistent models. The graph reflects README capabilities and source-index references; several service implementations and route details were not excerpted, so uncertain links are omitted.

Main entry points: [`app/Http/Controllers/QuotationController.php`](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/QuotationController.php) (Quotation actions), [`app/Http/Controllers/MushakInvoiceController.php`](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/MushakInvoiceController.php) (Mushak actions), [`app/Models/Quotation.php`](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Models/Quotation.php) (Quotation record), [`app/Http/Controllers/ChallanController.php`](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/ChallanController.php) (Challan actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_parties["Company and Parties"]
  node_party_ui["Party actions"]
  node_party_domain[("Party records")]
  node_company_ui["Company profile and files"]
  node_company_domain["Company documents"]
end

subgraph group_quotations["Quotation Lifecycle"]
  node_quotation_ui["Quotation actions"]
  node_quotation_domain["Quotation workflow"]
  node_quotation_calc["Quotation pricing"]
  node_quotation_state["Quotation state"]
  node_quotation_record[("Quotation record<br/>[Quotation.php]")]
  node_quotation_revision[("Revision record")]
  node_quotation_sharing["Quotation sharing"]
end

subgraph group_documents["Commercial Documents"]
  node_challan_ui["Challan actions"]
  node_challan_domain["Challan workflow"]
  node_challan_record[("Delivery challan")]
  node_invoice_ui["Invoice actions"]
  node_invoice_domain["Invoice workflow"]
  node_invoice_record[("Commercial invoice")]
end

subgraph group_tax["Tax Documents"]
  node_mushak_ui["Mushak actions"]
  node_mushak_domain["Mushak documents<br/>[MushakWriter.php]"]
  node_tax_domain["Tax calculations"]
end

subgraph group_internal["Shared Application Services"]
  node_audit[("Audit logging<br/>[AuditLogger.php]")]
  node_user_record[("User and roles<br/>[User.php]")]
end

node_staff(("Staff user"))

node_staff -->|"manages offers"| node_quotation_ui
node_quotation_ui -->|"invokes workflow"| node_quotation_domain
node_quotation_ui -->|"previews pricing"| node_quotation_calc
node_quotation_domain -.->|"updates record"| node_quotation_record
node_quotation_record -->|"tracks revisions"| node_quotation_revision
node_quotation_revision -->|"uses lifecycle"| node_quotation_state
node_quotation_ui -->|"selects customer"| node_party_domain
node_quotation_ui -->|"records events"| node_audit
node_quotation_sharing -->|"accesses offer"| node_quotation_record
node_staff -->|"maintains parties"| node_party_ui
node_party_ui -.->|"manages records"| node_party_domain
node_staff -->|"maintains company"| node_company_ui
node_company_ui -.->|"manages documents"| node_company_domain
node_staff -->|"prepares delivery"| node_challan_ui
node_challan_ui -->|"invokes workflow"| node_challan_domain
node_challan_ui -->|"checks accepted offer"| node_quotation_record
node_challan_domain -.->|"writes challan"| node_challan_record
node_staff -->|"creates invoices"| node_invoice_ui
node_invoice_ui -->|"invokes workflow"| node_invoice_domain
node_invoice_domain -.->|"writes invoice"| node_invoice_record
node_staff -->|"creates tax forms"| node_mushak_ui
node_mushak_ui -->|"writes Mushak"| node_mushak_domain
node_mushak_ui -->|"calculates VAT lines"| node_tax_domain
node_mushak_ui -->|"uses commercial invoice"| node_invoice_record
node_mushak_ui -->|"records events"| node_audit

click node_quotation_ui "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/QuotationController.php"
click node_quotation_domain "https://github.com/imroznet/ahmad-solution-erp/tree/main/app/Quotations"
click node_quotation_calc "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Quotations/QuotationCalculator.php"
click node_quotation_state "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Quotations/QuotationStatus.php"
click node_quotation_record "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Models/Quotation.php"
click node_quotation_revision "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Models/QuotationRevision.php"
click node_quotation_sharing "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Quotations/QuotationShareService.php"
click node_party_ui "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/PartyController.php"
click node_party_domain "https://github.com/imroznet/ahmad-solution-erp/tree/main/app/Parties"
click node_company_ui "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/CompanyProfileController.php"
click node_company_domain "https://github.com/imroznet/ahmad-solution-erp/tree/main/app/Company"
click node_challan_ui "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/ChallanController.php"
click node_challan_domain "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Documents/ChallanWorkflow.php"
click node_challan_record "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Models/DeliveryChallan.php"
click node_invoice_ui "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/InvoiceController.php"
click node_invoice_domain "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Documents/InvoiceWorkflow.php"
click node_invoice_record "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Models/CommercialInvoice.php"
click node_mushak_ui "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/MushakInvoiceController.php"
click node_mushak_domain "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Tax/MushakWriter.php"
click node_tax_domain "https://github.com/imroznet/ahmad-solution-erp/tree/main/app/Tax"
click node_audit "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Services/AuditLogger.php"
click node_user_record "https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Models/User.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_party_ui,node_party_domain,node_company_ui,node_company_domain,node_staff toneBlue
class node_quotation_ui,node_quotation_domain,node_quotation_calc,node_quotation_state,node_quotation_record,node_quotation_revision,node_quotation_sharing toneAmber
class node_challan_ui,node_challan_domain,node_challan_record,node_invoice_ui,node_invoice_domain,node_invoice_record toneMint
class node_mushak_ui,node_mushak_domain,node_tax_domain toneRose
class node_audit,node_user_record toneIndigo
```

## Components

### Company and Parties

- [Party actions](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/PartyController.php): `app/Http/Controllers/PartyController.php`
- [Party records](https://github.com/imroznet/ahmad-solution-erp/tree/main/app/Parties): `app/Parties`
- [Company profile and files](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/CompanyProfileController.php): `app/Http/Controllers/CompanyProfileController.php`
- [Company documents](https://github.com/imroznet/ahmad-solution-erp/tree/main/app/Company): `app/Company`

### Quotation Lifecycle

- [Quotation actions](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/QuotationController.php): `app/Http/Controllers/QuotationController.php`
- [Quotation workflow](https://github.com/imroznet/ahmad-solution-erp/tree/main/app/Quotations): `app/Quotations`
- [Quotation pricing](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Quotations/QuotationCalculator.php): `app/Quotations/QuotationCalculator.php`
- [Quotation state](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Quotations/QuotationStatus.php): `app/Quotations/QuotationStatus.php`
- [Quotation record](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Models/Quotation.php): `app/Models/Quotation.php`
- [Revision record](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Models/QuotationRevision.php): `app/Models/QuotationRevision.php`
- [Quotation sharing](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Quotations/QuotationShareService.php): `app/Quotations/QuotationShareService.php`

### Commercial Documents

- [Challan actions](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/ChallanController.php): `app/Http/Controllers/ChallanController.php`
- [Challan workflow](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Documents/ChallanWorkflow.php): `app/Documents/ChallanWorkflow.php`
- [Delivery challan](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Models/DeliveryChallan.php): `app/Models/DeliveryChallan.php`
- [Invoice actions](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/InvoiceController.php): `app/Http/Controllers/InvoiceController.php`
- [Invoice workflow](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Documents/InvoiceWorkflow.php): `app/Documents/InvoiceWorkflow.php`
- [Commercial invoice](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Models/CommercialInvoice.php): `app/Models/CommercialInvoice.php`

### Tax Documents

- [Mushak actions](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Http/Controllers/MushakInvoiceController.php): `app/Http/Controllers/MushakInvoiceController.php`
- [Mushak documents](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Tax/MushakWriter.php): `app/Tax/MushakWriter.php`
- [Tax calculations](https://github.com/imroznet/ahmad-solution-erp/tree/main/app/Tax): `app/Tax`

### Shared Application Services

- [Audit logging](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Services/AuditLogger.php): `app/Services/AuditLogger.php`
- [User and roles](https://github.com/imroznet/ahmad-solution-erp/blob/main/app/Models/User.php): `app/Models/User.php`

### Other components

- **Staff user**

## Connections

- Staff user → Quotation actions: manages offers
- Quotation actions → Quotation workflow: invokes workflow (evidence: `app/Http/Controllers/QuotationController.php`)
- Quotation actions → Quotation pricing: previews pricing (evidence: `app/Http/Controllers/QuotationController.php`)
- Quotation workflow → Quotation record: updates record (evidence: `app/Quotations/QuotationShareService.php`)
- Quotation record → Revision record: tracks revisions (evidence: `app/Models/Quotation.php`)
- Revision record → Quotation state: uses lifecycle (evidence: `app/Models/QuotationRevision.php`)
- Quotation actions → Party records: selects customer (evidence: `app/Http/Controllers/QuotationController.php`)
- Quotation actions → Audit logging: records events (evidence: `app/Http/Controllers/QuotationController.php`)
- Quotation sharing → Quotation record: accesses offer (evidence: `app/Quotations/QuotationShareService.php`)
- Staff user → Party actions: maintains parties
- Party actions → Party records: manages records
- Staff user → Company profile and files: maintains company
- Company profile and files → Company documents: manages documents
- Staff user → Challan actions: prepares delivery
- Challan actions → Challan workflow: invokes workflow (evidence: `app/Http/Controllers/ChallanController.php`)
- Challan actions → Quotation record: checks accepted offer (evidence: `app/Http/Controllers/ChallanController.php`)
- Challan workflow → Delivery challan: writes challan
- Staff user → Invoice actions: creates invoices
- Invoice actions → Invoice workflow: invokes workflow (evidence: `app/Http/Controllers/InvoiceController.php`)
- Invoice workflow → Commercial invoice: writes invoice
- Staff user → Mushak actions: creates tax forms
- Mushak actions → Mushak documents: writes Mushak (evidence: `app/Http/Controllers/MushakInvoiceController.php`)
- Mushak actions → Tax calculations: calculates VAT lines (evidence: `app/Http/Controllers/MushakInvoiceController.php`)
- Mushak actions → Commercial invoice: uses commercial invoice (evidence: `app/Http/Controllers/MushakInvoiceController.php`)
- Mushak actions → Audit logging: records events (evidence: `app/Http/Controllers/MushakInvoiceController.php`)
