# deadserpent/project22 architecture

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

- Interactive diagram: https://gitdiagram.com/deadserpent/project22
- Repository: https://github.com/deadserpent/project22

## Overview

Project22 is a small C# library for turning one JSON laboratory order into an accepted typed order or a rejection with validation errors. Its runtime flow is a public service entry point, deserialization into a raw DTO, field validation, and construction of a structured result. No persistence or external service integrations are in scope. The graph reflects the README and sampled source; it does not map individual validation rules.

Main entry points: [`src/OrderIntake/OrderIntakeService.cs`](https://github.com/deadserpent/project22/blob/main/src/OrderIntake/OrderIntakeService.cs) (Intake service), [`src/OrderIntake/Validation.cs`](https://github.com/deadserpent/project22/blob/main/src/OrderIntake/Validation.cs) (Order validator), [`src/OrderIntake/Models.cs`](https://github.com/deadserpent/project22/blob/main/src/OrderIntake/Models.cs) (Result models), [`src/OrderIntake/RawOrder.cs`](https://github.com/deadserpent/project22/blob/main/src/OrderIntake/RawOrder.cs) (Raw order DTO)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_caller(("Caller"))
node_service["Intake service"]
node_raw["Raw order DTO<br/>[RawOrder.cs]"]
node_validator["Order validator<br/>[Validation.cs]"]
node_models["Result models<br/>[Models.cs]"]

node_caller -->|"submits JSON"| node_service
node_service -->|"deserializes into"| node_raw
node_service -->|"calls validation"| node_validator
node_validator -->|"builds order and errors"| node_models
node_service -->|"returns result"| node_models

click node_service "https://github.com/deadserpent/project22/blob/main/src/OrderIntake/OrderIntakeService.cs"
click node_raw "https://github.com/deadserpent/project22/blob/main/src/OrderIntake/RawOrder.cs"
click node_validator "https://github.com/deadserpent/project22/blob/main/src/OrderIntake/Validation.cs"
click node_models "https://github.com/deadserpent/project22/blob/main/src/OrderIntake/Models.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_caller,node_models toneIndigo
class node_service,node_raw,node_validator toneTeal
```

## Components

### Other components

- **Caller**
- [Intake service](https://github.com/deadserpent/project22/blob/main/src/OrderIntake/OrderIntakeService.cs): `src/OrderIntake/OrderIntakeService.cs`
- [Raw order DTO](https://github.com/deadserpent/project22/blob/main/src/OrderIntake/RawOrder.cs): `src/OrderIntake/RawOrder.cs`
- [Order validator](https://github.com/deadserpent/project22/blob/main/src/OrderIntake/Validation.cs): `src/OrderIntake/Validation.cs`
- [Result models](https://github.com/deadserpent/project22/blob/main/src/OrderIntake/Models.cs): `src/OrderIntake/Models.cs`

## Connections

- Caller → Intake service: submits JSON (evidence: `README.md`)
- Intake service → Raw order DTO: deserializes into (evidence: `src/OrderIntake/OrderIntakeService.cs`)
- Intake service → Order validator: calls validation (evidence: `src/OrderIntake/OrderIntakeService.cs`)
- Order validator → Result models: builds order and errors (evidence: `src/OrderIntake/Validation.cs`)
- Intake service → Result models: returns result (evidence: `src/OrderIntake/OrderIntakeService.cs`)
