backend phase 4: geography, addresses & nurse service areas
Adds the province -> city -> district reference hierarchy (geo schema, seeded with 31 provinces + capital cities + Tehran's 22 districts), nurse service areas (district_id NULL = whole city, filtered-index-pair uniqueness -> 409), and encrypted, geocoded customer addresses with a single-primary invariant. Introduces the IGeocoder seam (mocked) and 409 Conflict on the result envelope. Public cascading lookups are cached behind a generation-token scheme with invalidate-on-admin-write. One EF migration (GeographyAddressesServiceAreas, applied). Contract + swagger snapshot + handoff/report/registry updated. 103 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -121,5 +121,15 @@ public class ApplicationDbContext: IdentityDbContext<User, Role, int, UserClaim,
|
||||
builder.Property(a => a.AccountHolderName).HasConversion(encrypted);
|
||||
builder.Property(a => a.Iban).HasConversion(encrypted);
|
||||
});
|
||||
|
||||
// b4 address PII: street line, postal code and recipient contact are encrypted at rest through
|
||||
// the same seam; the title label and coordinates are not PII and stay plaintext.
|
||||
modelBuilder.Entity<CustomerAddress>(builder =>
|
||||
{
|
||||
builder.Property(a => a.AddressLine).HasConversion(encrypted);
|
||||
builder.Property(a => a.PostalCode).HasConversion(encrypted);
|
||||
builder.Property(a => a.RecipientName).HasConversion(encrypted);
|
||||
builder.Property(a => a.RecipientPhone).HasConversion(encrypted);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user