Builds the four-seam, three-write-path reference demo backend: case-framework (seam D stand-in), legacy-backend/frontend (SQL Server, seams A/B/C targets), and new-backend (Domain/Application/Infrastructure.*/Api implementing the source resolver, take/release-ownership, write-through translator, and owned assessment flow), wired together via docker-compose with a plain placeholder frontend standing in for the Angular portal until Session 2. All 11 Architecture.Tests pass and scripts/smoke.sh passes end-to-end against a fresh `docker compose up`, covering acceptance criteria 1-3 and 7-22. Fixes two real domain bugs found only once the stack ran for real: the BSN eleven-proof checksum trivially passes all-zero digits, and the adoption mapper silently treated a partial legacy address as absent instead of failing loudly. Also fixes several environment-specific integration issues (rootless Podman/SELinux bind-mount permissions, a buildah NuGet layer-caching bug, SqlClient's invariant-globalization incompatibility, and an nginx path-prefix mismatch for the legacy frontend). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
22 lines
939 B
C#
22 lines
939 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Design;
|
|
|
|
namespace New.Infrastructure.Persistence;
|
|
|
|
/// <summary>
|
|
/// Design-time-only factory so `dotnet ef migrations add/update` can
|
|
/// construct a NewDbContext without a running host (this project has no DI
|
|
/// container of its own - New.Api's ServiceCollectionExtensions.AddPersistenceInfrastructure
|
|
/// is what wires the real DbContextOptions at runtime, reading
|
|
/// ConnectionStrings__New from the environment). Never used outside `dotnet ef`.
|
|
/// </summary>
|
|
public sealed class NewDbContextFactory : IDesignTimeDbContextFactory<NewDbContext>
|
|
{
|
|
public NewDbContext CreateDbContext(string[] args)
|
|
{
|
|
var optionsBuilder = new DbContextOptionsBuilder<NewDbContext>();
|
|
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=newdb;Username=postgres;Password=postgres");
|
|
return new NewDbContext(optionsBuilder.Options);
|
|
}
|
|
}
|