Files
Heimdall/src/Heimdall.Domain/Entities/CameraDetectionProfile.cs
T
Arnaud Dartois b217c932e8 feat(mvp): implement MVP multi-site platform
Complete MVP implementation (Étape 1) covering:
- Domain: primitives (Entity<TId>, ValueObject), 10 entities, 6 enums
- EF Core: AppDbContext + Identity, 8 EntityTypeConfigurations, audit/soft-delete interceptors, initial migration
- Application: service interfaces, DTOs, FluentValidation, ServiceResult pattern
- Security: Identity + JWT + API Key multi-auth, role-based permissions, constant-time key validation
- API: Auth/Sites/Agents controllers with explicit auth scheme policies
- Workers: Hangfire PostgreSQL setup with schema isolation, HeartbeatMonitorJob
- Agent: registration service + 30s heartbeat loop
- Docker: multi-stage Dockerfiles for central + agent, docker-compose.yml
- CI/CD: GitHub Actions pipeline with build+test and Docker build
- Tests: 13 domain tests (Site, Agent, Camera entities)

Architecture decisions per deliberation council:
- API Key via AuthenticationHandler<T> (not middleware)
- Explicit [Authorize(AuthenticationSchemes)] on all endpoints
- Event/Recording/Person/Vehicle deferred from initial migration
- Hangfire compatible with .NET 10 (v1.8.17)
2026-07-16 20:53:56 +00:00

49 lines
1.6 KiB
C#

namespace Heimdall.Domain.Entities;
/// <summary>
/// Per-camera AI detection profile.
/// Controls what the Agent detects and what AI processing runs on the Central.
/// </summary>
public class CameraDetectionProfile
{
public Guid CameraId { get; private set; }
// Object types to detect
public bool DetectPerson { get; set; } = true;
public bool DetectVehicle { get; set; } = true;
public bool DetectAnimal { get; set; }
public bool DetectPackage { get; set; }
public bool DetectMotion { get; set; } = true;
// Heavy AI (Central GPU)
public bool FaceRecognition { get; set; } = true;
public bool LicensePlateRecognition { get; set; } = true;
// Snapshot parameters
public int IdleIntervalMs { get; set; } = 1000;
public int MotionIntervalMs { get; set; } = 500;
public int ActiveIntervalMs { get; set; } = 200;
public double MotionThreshold { get; set; } = 0.3;
// YOLO
public string YoloModel { get; set; } = "yolov8n";
public double MinConfidence { get; set; } = 0.4;
// Deduplication
public bool RequireMotionForAI { get; set; } = true;
public double IoUThreshold { get; set; } = 0.6;
public int PersonCooldownSec { get; set; } = 30;
public int VehicleCooldownSec { get; set; } = 60;
public int AnimalCooldownSec { get; set; } = 120;
public int MaxEventsPerMinute { get; set; } = 20;
public Camera Camera { get; private set; } = null!;
private CameraDetectionProfile() { } // EF Core
public CameraDetectionProfile(Guid cameraId)
{
CameraId = cameraId;
}
}