Multi-agent sites need automatic camera distribution, failover when
an agent goes offline, and rebalancing when new agents join.
Adds CameraAssignment entity with audit trail, 4 assignment strategies
(RoundRobin, GpuPriority, LeastCameras, Failover), a Hangfire failover
job that checks for stale heartbeats every 60s, a discovery coordinator
for leader election, 6 REST endpoints, EF migration, and DI registration.
Fix the filtered index column name casing in ALL .Designer.cs files
and AppDbContextModelSnapshot.cs:
- "status" → "Status" (Agent.LastHeartbeat index)
- "is_deleted" → "IsDeleted" (Site.IsDeleted index)
These must match the actual column names (PascalCase) since
PostgreSQL quoted identifiers are case-sensitive.
Also fix the InitialCreate migration .cs file directly.
All 10 references across 5 snapshot files corrected.
Added AppUser navigation property to AuditLog entity with EF Core
configuration (FK -> UserId, SetNull on delete). Replaced the sub-query
in AuditLogService ListAsync with a direct navigation property access,
enabling EF Core to generate a single LEFT JOIN instead of N sub-queries.
Migration: AddAuditLogUserRelation
Setting LockoutEnd to UtcNow locked the user out instead of forcing
a password change. Added MustChangePassword boolean to AppUser entity
with EF Core migration. ResetPasswordAsync now sets this flag instead
of locking the account.