# digibhatia/billing-agent-bmad architecture

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

- Interactive diagram: https://gitdiagram.com/digibhatia/billing-agent-bmad
- Repository: https://github.com/digibhatia/billing-agent-bmad

## Overview

A small telecom billing demo offers two ways to compare customer totals: a single-customer CLI and a batch check. Both use the in-memory customer records and the two independent calculation functions; the batch mode reports whether their results match. The source excerpts show these calls directly. The records are an in-memory dictionary, not a persistent database.

Main entry points: [`main.py`](https://github.com/digibhatia/billing-agent-bmad/blob/main/main.py) (Single-customer CLI), [`billing.py`](https://github.com/digibhatia/billing-agent-bmad/blob/main/billing.py) (Batch comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_cli["Single-customer CLI<br/>[main.py]"]
node_batch["Batch comparison<br/>[billing.py]"]
node_records["Customer records<br/>[billing.py]"]
node_invoice["Invoice calculation<br/>[billing.py]"]
node_statement["Statement calculation<br/>[billing.py]"]

node_user -->|"runs"| node_cli
node_user -->|"runs"| node_batch
node_cli -->|"reads"| node_records
node_cli -->|"calls"| node_invoice
node_cli -->|"calls"| node_statement
node_batch -->|"calls"| node_invoice
node_batch -->|"calls"| node_statement
node_invoice -->|"reads"| node_records
node_statement -->|"reads"| node_records

click node_cli "https://github.com/digibhatia/billing-agent-bmad/blob/main/main.py"
click node_batch "https://github.com/digibhatia/billing-agent-bmad/blob/main/billing.py"
click node_records "https://github.com/digibhatia/billing-agent-bmad/blob/main/billing.py"
click node_invoice "https://github.com/digibhatia/billing-agent-bmad/blob/main/billing.py"
click node_statement "https://github.com/digibhatia/billing-agent-bmad/blob/main/billing.py"

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_user toneBlue
class node_cli,node_batch,node_records,node_invoice,node_statement toneTeal
```

## Components

### Other components

- **User**
- [Single-customer CLI](https://github.com/digibhatia/billing-agent-bmad/blob/main/main.py): `main.py`
- [Batch comparison](https://github.com/digibhatia/billing-agent-bmad/blob/main/billing.py): `billing.py`
- [Customer records](https://github.com/digibhatia/billing-agent-bmad/blob/main/billing.py): `billing.py`
- [Invoice calculation](https://github.com/digibhatia/billing-agent-bmad/blob/main/billing.py): `billing.py`
- [Statement calculation](https://github.com/digibhatia/billing-agent-bmad/blob/main/billing.py): `billing.py`

## Connections

- User → Single-customer CLI: runs (evidence: `README.md`)
- User → Batch comparison: runs (evidence: `README.md`)
- Single-customer CLI → Customer records: reads (evidence: `main.py`)
- Single-customer CLI → Invoice calculation: calls (evidence: `main.py`)
- Single-customer CLI → Statement calculation: calls (evidence: `main.py`)
- Batch comparison → Invoice calculation: calls (evidence: `billing.py`)
- Batch comparison → Statement calculation: calls (evidence: `billing.py`)
- Invoice calculation → Customer records: reads (evidence: `billing.py`)
- Statement calculation → Customer records: reads (evidence: `billing.py`)
