# camposcodinghub/primoautoeletrica architecture

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

- Interactive diagram: https://gitdiagram.com/camposcodinghub/primoautoeletrica
- Repository: https://github.com/camposcodinghub/primoautoeletrica

## Overview

PRIMOX Workshop is an offline-first automotive workshop ERP. Its documented daily workflow runs from customer and vehicle registration through quoting, work-order conversion, point-of-sale receipt, cash closing, and dashboard follow-up. The graph also preserves the README’s major diagnostic, inventory/purchasing, fiscal, and corporate capabilities. Several feature implementations were not sampled, so those subsystem links are shown as unverified rather than as asserted calls.

Main entry points: [`PrimoAutoEletrica/App.xaml.cs`](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/App.xaml.cs) (Desktop application), [`PrimoAutoEletrica.Api/Program.cs`](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica.Api/Program.cs) (Work-order API), [`PrimoAutoEletrica/UserControls/ClientesControl.xaml.cs`](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/UserControls/ClientesControl.xaml.cs) (Customer records), [`PrimoAutoEletrica/Models/Veiculo.cs`](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Models/Veiculo.cs) (Vehicle records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Workshop workflow"]
  node_desktop["Desktop application<br/>[App.xaml.cs]"]
  node_customers["Customer records"]
  node_vehicles["Vehicle records<br/>[Veiculo.cs]"]
  node_quotes["Quotes"]
  node_workorders["Work orders"]
  node_pos["Point of sale<br/>[PDVControl.xaml.cs]"]
  node_cash["Cash closing<br/>[CaixaService.cs]"]
  node_dashboard["Dashboard"]
end

subgraph group_operations["Business operations"]
  node_scheduling["Scheduling and bays"]
  node_inventory["Inventory"]
  node_purchasing["Purchasing"]
  node_transfers["Branch transfers"]
  node_fleet["Fleet management"]
  node_tools["Tool control"]
end

subgraph group_technical["Diagnostics and fiscal"]
  node_diagnostics["AI diagnostics"]
  node_guided["Guided electrical tests"]
  node_fiscal["Fiscal center"]
end

subgraph group_platform["Application and persistence"]
  node_database[("Local database<br/>[DatabaseService.cs]")]
  node_sync["Local network sync"]
  node_osapi["Work-order API<br/>[Program.cs]"]
  node_osusecases["Work-order use cases"]
  node_osrepo[("SQLite OS repository")]
end

node_staff(("Workshop staff"))
node_gateway["Fiscal gateway"]

node_staff -->|"uses"| node_desktop
node_desktop -.->|"opens"| node_customers
node_customers -->|"registers"| node_vehicles
node_vehicles -->|"enables"| node_quotes
node_quotes -->|"converts to"| node_workorders
node_workorders -->|"receives at"| node_pos
node_pos -->|"settles at"| node_cash
node_cash -->|"followed on"| node_dashboard
node_staff -.->|"schedules"| node_scheduling
node_staff -.->|"manages"| node_inventory
node_purchasing -.->|"replenishes"| node_inventory
node_staff -.->|"moves stock"| node_transfers
node_staff -.->|"manages"| node_fleet
node_staff -.->|"checks out"| node_tools
node_staff -.->|"consults"| node_diagnostics
node_diagnostics -.->|"supports"| node_guided
node_staff -.->|"issues documents"| node_fiscal
node_fiscal -->|"transmits through"| node_gateway
node_desktop -->|"uses"| node_database
node_desktop -->|"sends updates"| node_sync
node_osapi -->|"registers"| node_osusecases
node_osapi -->|"registers"| node_osrepo
node_osusecases -.->|"persists through"| node_osrepo

click node_desktop "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/App.xaml.cs"
click node_customers "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/UserControls/ClientesControl.xaml.cs"
click node_vehicles "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Models/Veiculo.cs"
click node_quotes "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/UserControls/OrcamentosControl.xaml.cs"
click node_workorders "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/UserControls/OrdensServicoControl.xaml.cs"
click node_pos "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/UserControls/PDVControl.xaml.cs"
click node_cash "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/CaixaService.cs"
click node_dashboard "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/UserControls/DashboardControl.xaml.cs"
click node_scheduling "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/AgendamentoDatabaseService.cs"
click node_inventory "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/EstoqueOperationalService.cs"
click node_purchasing "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/GestaoComprasService.cs"
click node_transfers "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/TransferenciaEstoqueService.cs"
click node_fleet "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/GestaoFrotasService.cs"
click node_tools "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/FerramentaService.cs"
click node_diagnostics "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/AI/AutomotiveDiagnosticRAGService.cs"
click node_guided "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/CalculadoraQuedaTensaoService.cs"
click node_fiscal "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/Fiscal/FiscalApplicationService.cs"
click node_database "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/DatabaseService.cs"
click node_sync "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/LocalSyncService.cs"
click node_osapi "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica.Api/Program.cs"
click node_osusecases "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PRIMOX.Application/UseCases/OrdensServico/AbrirOrdemServicoUseCase.cs"
click node_osrepo "https://github.com/camposcodinghub/primoautoeletrica/blob/main/PRIMOX.Infrastructure/Persistence/SqliteOrdemServicoRepository.cs"

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_desktop,node_customers,node_vehicles,node_quotes,node_workorders,node_pos,node_cash,node_dashboard toneBlue
class node_scheduling,node_inventory,node_purchasing,node_transfers,node_fleet,node_tools toneAmber
class node_diagnostics,node_guided,node_fiscal toneMint
class node_database,node_sync,node_osapi,node_osusecases,node_osrepo toneRose
class node_staff,node_gateway toneIndigo
```

## Components

### Workshop workflow

- [Desktop application](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/App.xaml.cs): `PrimoAutoEletrica/App.xaml.cs`
- [Customer records](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/UserControls/ClientesControl.xaml.cs): `PrimoAutoEletrica/UserControls/ClientesControl.xaml.cs`
- [Vehicle records](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Models/Veiculo.cs): `PrimoAutoEletrica/Models/Veiculo.cs`
- [Quotes](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/UserControls/OrcamentosControl.xaml.cs): `PrimoAutoEletrica/UserControls/OrcamentosControl.xaml.cs`
- [Work orders](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/UserControls/OrdensServicoControl.xaml.cs): `PrimoAutoEletrica/UserControls/OrdensServicoControl.xaml.cs`
- [Point of sale](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/UserControls/PDVControl.xaml.cs): `PrimoAutoEletrica/UserControls/PDVControl.xaml.cs`
- [Cash closing](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/CaixaService.cs): `PrimoAutoEletrica/Services/CaixaService.cs`
- [Dashboard](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/UserControls/DashboardControl.xaml.cs): `PrimoAutoEletrica/UserControls/DashboardControl.xaml.cs`

### Business operations

- [Scheduling and bays](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/AgendamentoDatabaseService.cs): `PrimoAutoEletrica/Services/AgendamentoDatabaseService.cs`
- [Inventory](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/EstoqueOperationalService.cs): `PrimoAutoEletrica/Services/EstoqueOperationalService.cs`
- [Purchasing](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/GestaoComprasService.cs): `PrimoAutoEletrica/Services/GestaoComprasService.cs`
- [Branch transfers](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/TransferenciaEstoqueService.cs): `PrimoAutoEletrica/Services/TransferenciaEstoqueService.cs`
- [Fleet management](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/GestaoFrotasService.cs): `PrimoAutoEletrica/Services/GestaoFrotasService.cs`
- [Tool control](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/FerramentaService.cs): `PrimoAutoEletrica/Services/FerramentaService.cs`

### Diagnostics and fiscal

- [AI diagnostics](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/AI/AutomotiveDiagnosticRAGService.cs): `PrimoAutoEletrica/Services/AI/AutomotiveDiagnosticRAGService.cs`
- [Guided electrical tests](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/CalculadoraQuedaTensaoService.cs): `PrimoAutoEletrica/Services/CalculadoraQuedaTensaoService.cs`
- [Fiscal center](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/Fiscal/FiscalApplicationService.cs): `PrimoAutoEletrica/Services/Fiscal/FiscalApplicationService.cs`

### Application and persistence

- [Local database](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/DatabaseService.cs): `PrimoAutoEletrica/Services/DatabaseService.cs`
- [Local network sync](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica/Services/LocalSyncService.cs): `PrimoAutoEletrica/Services/LocalSyncService.cs`
- [Work-order API](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PrimoAutoEletrica.Api/Program.cs): `PrimoAutoEletrica.Api/Program.cs`
- [Work-order use cases](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PRIMOX.Application/UseCases/OrdensServico/AbrirOrdemServicoUseCase.cs): `PRIMOX.Application/UseCases/OrdensServico/AbrirOrdemServicoUseCase.cs`
- [SQLite OS repository](https://github.com/camposcodinghub/primoautoeletrica/blob/main/PRIMOX.Infrastructure/Persistence/SqliteOrdemServicoRepository.cs): `PRIMOX.Infrastructure/Persistence/SqliteOrdemServicoRepository.cs`

### Other components

- **Workshop staff**
- **Fiscal gateway**

## Connections

- Workshop staff → Desktop application: uses (evidence: `README.md`)
- Desktop application → Customer records: opens
- Customer records → Vehicle records: registers (evidence: `README.md`)
- Vehicle records → Quotes: enables (evidence: `README.md`)
- Quotes → Work orders: converts to (evidence: `README.md`)
- Work orders → Point of sale: receives at (evidence: `README.md`)
- Point of sale → Cash closing: settles at (evidence: `README.md`)
- Cash closing → Dashboard: followed on (evidence: `README.md`)
- Workshop staff → Scheduling and bays: schedules
- Workshop staff → Inventory: manages
- Purchasing → Inventory: replenishes
- Workshop staff → Branch transfers: moves stock
- Workshop staff → Fleet management: manages
- Workshop staff → Tool control: checks out
- Workshop staff → AI diagnostics: consults
- AI diagnostics → Guided electrical tests: supports
- Workshop staff → Fiscal center: issues documents
- Fiscal center → Fiscal gateway: transmits through (evidence: `README.md`)
- Desktop application → Local database: uses (evidence: `PrimoAutoEletrica/App.xaml.cs`)
- Desktop application → Local network sync: sends updates (evidence: `PrimoAutoEletrica/App.xaml.cs`)
- Work-order API → Work-order use cases: registers (evidence: `PrimoAutoEletrica.Api/Program.cs`)
- Work-order API → SQLite OS repository: registers (evidence: `PrimoAutoEletrica.Api/Program.cs`)
- Work-order use cases → SQLite OS repository: persists through
