backend phase 9

This commit is contained in:
hamid
2026-07-06 19:23:44 +03:30
parent 2cfc082a04
commit 12c7e51c32
101 changed files with 11666 additions and 8 deletions
@@ -1,6 +1,7 @@
using System.Reflection;
using Baya.Application.Contracts.Common;
using Baya.Domain.Common;
using Baya.Domain.Entities.Booking;
using Baya.Domain.Entities.Identity;
using Baya.Domain.Entities.User;
using Baya.Domain.Entities.Verification;
@@ -139,5 +140,22 @@ public class ApplicationDbContext: IdentityDbContext<User, Role, int, UserClaim,
{
builder.Property(c => c.CredentialNumber).HasConversion(encrypted);
});
// b9 snapshot + clinical PII: the frozen address snapshot and every booking_care_instructions field
// are encrypted at rest through the same seam. The care fields are the stage-2 clinical disclosure —
// decrypted only in the gated care-instructions read (assigned nurse + admin, post-confirmation).
modelBuilder.Entity<Booking>(builder =>
{
builder.Property(b => b.AddressSnapshotJson).HasConversion(encrypted);
});
modelBuilder.Entity<BookingCareInstruction>(builder =>
{
builder.Property(c => c.CurrentConditions).HasConversion(encrypted);
builder.Property(c => c.Medications).HasConversion(encrypted);
builder.Property(c => c.Allergies).HasConversion(encrypted);
builder.Property(c => c.SpecialInstructions).HasConversion(encrypted);
builder.Property(c => c.EmergencyContactName).HasConversion(encrypted);
builder.Property(c => c.EmergencyContactPhone).HasConversion(encrypted);
});
}
}