feature: In-App Simulation Runner (Backend)
CI / frontend (push) Canceled after 0s
CI / backend (push) Canceled after 8m32s

This commit is contained in:
voltsrage
2026-08-06 01:52:53 +08:00
parent 943d41339c
commit 24f45851e9
83 changed files with 3974 additions and 120 deletions
@@ -25,6 +25,7 @@ public class PatientConfiguration : IEntityTypeConfiguration<Patient>
.HasColumnName("name_search_token")
.HasMaxLength(64);
builder.Property(p => p.CreatedAt).HasColumnName("created_at").HasDefaultValueSql("NOW()");
builder.Property(p => p.IsSimulated).HasColumnName("is_simulated").HasDefaultValue(false);
// MRN uses exact-match unique index — MRN lookups are always equality checks,
// never LIKE/ILIKE. A B-tree unique index satisfies O(log n) point lookup.
@@ -33,5 +34,9 @@ public class PatientConfiguration : IEntityTypeConfiguration<Patient>
// at this scale (pg_trgm GIN would be warranted at >500k patients).
builder.HasIndex(p => p.Mrn).IsUnique();
builder.HasIndex(p => p.NameSearchToken);
// Filtered index keeps Phase 38 simulated-patient purge cheap.
builder.HasIndex(p => p.IsSimulated)
.HasDatabaseName("IX_Patients_IsSimulated")
.HasFilter("is_simulated = true");
}
}