feat: implement strangler-fig-demo Session 1 (backend + smoke script)
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>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using New.Application.Ports;
|
||||
using New.Infrastructure.CaseFramework.Dtos;
|
||||
|
||||
namespace New.Infrastructure.CaseFramework;
|
||||
|
||||
/// <summary>Seam D: implements <see cref="ICaseFrameworkGateway"/> against the case-framework's own contract.</summary>
|
||||
public sealed class CaseFrameworkGateway : ICaseFrameworkGateway
|
||||
{
|
||||
private readonly CaseFrameworkClient _client;
|
||||
|
||||
// Internal constructor parameter type (CaseFrameworkClient is internal -
|
||||
// its API is shaped by case-framework DTOs). Registered via an explicit
|
||||
// factory in ServiceCollectionExtensions; see that file's remarks.
|
||||
internal CaseFrameworkGateway(CaseFrameworkClient client) => _client = client;
|
||||
|
||||
public async Task<CaseCreated> CreateCaseAsync(string caseTypeCode, string externalReference, IReadOnlyList<string> participants, CancellationToken ct)
|
||||
{
|
||||
var response = await _client.CreateCaseAsync(
|
||||
new CreateCaseRequest(caseTypeCode, externalReference, participants.ToList()), ct);
|
||||
return new CaseCreated(response.Id, response.ProcessStatus);
|
||||
}
|
||||
|
||||
public async Task<string?> GetProcessStatusAsync(Guid caseId, CancellationToken ct)
|
||||
{
|
||||
var response = await _client.GetCaseAsync(caseId, ct);
|
||||
return response?.ProcessStatus;
|
||||
}
|
||||
|
||||
public async Task<TaskCreated> CreateTaskAsync(Guid caseId, string code, string description, CancellationToken ct)
|
||||
{
|
||||
var response = await _client.CreateTaskAsync(caseId, new CreateTaskRequest(code, description), ct);
|
||||
return new TaskCreated(response.TaskId, response.Open);
|
||||
}
|
||||
|
||||
public Task CompleteTaskAsync(Guid caseId, Guid taskId, CancellationToken ct) =>
|
||||
_client.CompleteTaskAsync(caseId, taskId, ct);
|
||||
|
||||
public Task<bool> RequestClosureAsync(Guid caseId, CancellationToken ct) =>
|
||||
_client.RequestClosureAsync(caseId, ct);
|
||||
}
|
||||
Reference in New Issue
Block a user