# Module: Azaion.Common.Entities.DetectionClass ## Purpose Domain entity for a single detection class shown to operators in the Detection Classes admin table. Persisted to the `detection_classes` table; managed via the `/classes` admin endpoints introduced by AZ-513. > **Cycle 1 (2026-05-13) origin** — added by AZ-513 to back the new admin `/classes` CRUD endpoints; previously the read path was served by another service (likely `annotations/`) and admin/ had no own model for it. ## Public Interface | Property | Type | Description | |----------|------|-------------| | `Id` | `int` | Auto-assigned identity (DB-generated via `InsertWithInt32IdentityAsync`) | | `Name` | `string` | Full display name (max 120 chars per validator) | | `ShortName` | `string` | Short label used in tight UI (max 20 chars) | | `Color` | `string` | UI color (e.g. `"#FF0000"`, max 20 chars — accepts hex strings or named-color tokens) | | `MaxSizeM` | `double` | Maximum real-world object size in meters (must be > 0) | | `PhotoMode` | `string?` | Optional capture-mode hint (max 20 chars when present) | | `CreatedAt` | `DateTime` | UTC creation timestamp set by the service on insert | ## Internal Logic Plain POCO; no behaviour. Identity is assigned by the database on insert (`InsertWithInt32IdentityAsync`). ## Dependencies None (no `using` directives on `Azaion.Services` / external libs). ## Consumers - `Azaion.Services.DetectionClassService` — CRUD operations - `AzaionDb.DetectionClasses` — linq2db table mapping (see `common_database_azaion_db.md`) - `Azaion.AdminApi.Program` — `POST/PATCH/DELETE /classes` endpoints ## Data Models Maps 1:1 to the `detection_classes` PostgreSQL table. ## Configuration None. ## External Integrations None directly; persisted via `IDbFactory` → PostgreSQL. ## Security Data is operator-controlled metadata; no PII or secrets. ## Tests - `e2e/Azaion.E2E/Tests/DetectionClassesTests.cs` — covers AZ-513 ACs 1–9