From 10d30fbc16371a1eb6107340f37ec2977f7cc93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ren=C3=A9=20White=20Enciso?= Date: Mon, 9 Mar 2026 11:57:46 -0600 Subject: [PATCH] chore(operations-dal): checkpoint pending development updates --- .dockerignore | 9 +++++ Directory.Build.props | 4 +- Dockerfile | 20 ++++++++++ Operations.DAL.slnx | 1 + docs/roadmap/feature-epics.md | 18 +++++++++ docs/runbooks/containerization.md | 38 +++++++++++++++++++ .../Operations.DAL.Host.csproj | 13 +++++++ src/Operations.DAL.Host/Program.cs | 33 ++++++++++++++++ .../Properties/launchSettings.json | 23 +++++++++++ .../appsettings.Development.json | 8 ++++ src/Operations.DAL.Host/appsettings.json | 9 +++++ 11 files changed, 174 insertions(+), 2 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docs/roadmap/feature-epics.md create mode 100644 docs/runbooks/containerization.md create mode 100644 src/Operations.DAL.Host/Operations.DAL.Host.csproj create mode 100644 src/Operations.DAL.Host/Program.cs create mode 100644 src/Operations.DAL.Host/Properties/launchSettings.json create mode 100644 src/Operations.DAL.Host/appsettings.Development.json create mode 100644 src/Operations.DAL.Host/appsettings.json diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..636f769 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +**/bin/ +**/obj/ +.vs/ +TestResults/ +.git/ +.repo-tasks/ +.repo-context/ +.tasks/ +.agile/ diff --git a/Directory.Build.props b/Directory.Build.props index 60bf343..5a99ce1 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,8 +3,8 @@ AgileWebs AgileWebs git - http://192.168.10.100:3000/AgileWebs/operations-dal - http://192.168.10.100:3000/AgileWebs/operations-dal + https://gitea.dream-views.com/AgileWebs/operations-dal + https://gitea.dream-views.com/AgileWebs/operations-dal false diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..47e5142 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# syntax=docker/dockerfile:1.7 +ARG SDK_IMAGE=mcr.microsoft.com/dotnet/sdk:10.0 +ARG RUNTIME_IMAGE=mcr.microsoft.com/dotnet/aspnet:10.0 + +FROM ${SDK_IMAGE} AS build +ARG NUGET_FEED_URL=https://gitea.dream-views.com/api/packages/AgileWebs/nuget/index.json +ARG NUGET_FEED_USERNAME= +ARG NUGET_FEED_TOKEN= +WORKDIR /src +COPY . . +RUN if [ -n "$NUGET_FEED_USERNAME" ] && [ -n "$NUGET_FEED_TOKEN" ]; then dotnet nuget add source "$NUGET_FEED_URL" --name gitea-org --username "$NUGET_FEED_USERNAME" --password "$NUGET_FEED_TOKEN" --store-password-in-clear-text --allow-insecure-connections --configfile /root/.nuget/NuGet/NuGet.Config; fi +RUN dotnet restore "src/Operations.DAL.Host/Operations.DAL.Host.csproj" --configfile /root/.nuget/NuGet/NuGet.Config +RUN dotnet publish "src/Operations.DAL.Host/Operations.DAL.Host.csproj" -c Release -o /app/publish /p:UseAppHost=false --no-restore + +FROM ${RUNTIME_IMAGE} AS runtime +WORKDIR /app +ENV ASPNETCORE_URLS=http://+:8080 ASPNETCORE_ENVIRONMENT=Production +EXPOSE 8080 +COPY --from=build /app/publish . +ENTRYPOINT ["dotnet", "Operations.DAL.Host.dll"] diff --git a/Operations.DAL.slnx b/Operations.DAL.slnx index 11b6302..7ab4a27 100644 --- a/Operations.DAL.slnx +++ b/Operations.DAL.slnx @@ -1,5 +1,6 @@ + diff --git a/docs/roadmap/feature-epics.md b/docs/roadmap/feature-epics.md new file mode 100644 index 0000000..df129b2 --- /dev/null +++ b/docs/roadmap/feature-epics.md @@ -0,0 +1,18 @@ +# Feature Epics + +## Repository +operations-dal + +## Core Epics +- Epic 1: Expand domain-aligned capabilities for restaurant operations. +- Epic 2: Stabilize service contracts for containerized runtime integration. +- Epic 3: Improve observability and operational readiness for demo compose environments. + +## Domain-Specific Candidate Features +- Order lifecycle consistency and state transitions. +- Kitchen queue and dispatch optimization hooks. +- Operations control-plane policies (flags, service windows, overrides). +- POS closeout and settlement summary alignment. + +## Documentation Contract +Any code change in this repository must include docs updates in the same branch. diff --git a/docs/runbooks/containerization.md b/docs/runbooks/containerization.md new file mode 100644 index 0000000..812ecf5 --- /dev/null +++ b/docs/runbooks/containerization.md @@ -0,0 +1,38 @@ +# Containerization Runbook + +## Image Build + +```bash +docker build --build-arg NUGET_FEED_USERNAME= --build-arg NUGET_FEED_TOKEN= -t agilewebs/operations-dal:dev . +``` + +## Local Run + +```bash +docker run --rm -p 8080:8080 --name operations-dal agilewebs/operations-dal:dev +``` + +## Health Probe + +- Path: `/health` +- Fallback path: `/healthz` +- Port: `8080` + +## Runtime Notes + +- Exposes internal DAL probe endpoints for operations configuration reads/writes. + +## Health Endpoint Consistency + +- Canonical probe: `/health` +- Compatibility probe: `/healthz` +- Container port: `8080` + +## Demo Integration + +- Participates in: **restaurant** demo compose stack. +- Integration artifact path: `greenfield/demo/restaurant/docker-compose.yml` +## Known Limitations + +- Current runtime adapters are still predominantly in-memory for deterministic local/demo behavior. +- Demo PostgreSQL seeds validate integration contracts and smoke determinism, but do not yet imply full persistence implementation parity. diff --git a/src/Operations.DAL.Host/Operations.DAL.Host.csproj b/src/Operations.DAL.Host/Operations.DAL.Host.csproj new file mode 100644 index 0000000..25010b2 --- /dev/null +++ b/src/Operations.DAL.Host/Operations.DAL.Host.csproj @@ -0,0 +1,13 @@ + + + + net10.0 + enable + enable + + + + + + + diff --git a/src/Operations.DAL.Host/Program.cs b/src/Operations.DAL.Host/Program.cs new file mode 100644 index 0000000..76ae583 --- /dev/null +++ b/src/Operations.DAL.Host/Program.cs @@ -0,0 +1,33 @@ +using Operations.DAL.Contracts; +using Operations.DAL.Repositories; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddHealthChecks(); +builder.Services.AddSingleton(); + +var app = builder.Build(); + +app.MapGet("/internal/operations-dal/config", async ( + string locationId, + DateTime? effectiveAtUtc, + IOperationsConfigRepository repository, + CancellationToken ct) => +{ + var effectiveAt = effectiveAtUtc ?? DateTime.UtcNow; + var record = await repository.GetEffectiveAsync(locationId, effectiveAt, ct); + return record is null ? Results.NotFound() : Results.Ok(record); +}); + +app.MapPost("/internal/operations-dal/config", async ( + OperationsConfigRecord record, + IOperationsConfigRepository repository, + CancellationToken ct) => +{ + await repository.UpsertAsync(record, ct); + return Results.Accepted($"/internal/operations-dal/config?locationId={Uri.EscapeDataString(record.LocationId)}", record); +}); + +app.MapHealthChecks("/health"); +app.MapHealthChecks("/healthz"); + +app.Run(); diff --git a/src/Operations.DAL.Host/Properties/launchSettings.json b/src/Operations.DAL.Host/Properties/launchSettings.json new file mode 100644 index 0000000..c55f6a2 --- /dev/null +++ b/src/Operations.DAL.Host/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:0", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:0;http://localhost:0", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/Operations.DAL.Host/appsettings.Development.json b/src/Operations.DAL.Host/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/src/Operations.DAL.Host/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/Operations.DAL.Host/appsettings.json b/src/Operations.DAL.Host/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/src/Operations.DAL.Host/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}