chore(kitchen-service): checkpoint pending development updates
This commit is contained in:
parent
4d89f05897
commit
02cf18a0a6
9
.dockerignore
Normal file
9
.dockerignore
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
**/bin/
|
||||||
|
**/obj/
|
||||||
|
.vs/
|
||||||
|
TestResults/
|
||||||
|
.git/
|
||||||
|
.repo-tasks/
|
||||||
|
.repo-context/
|
||||||
|
.tasks/
|
||||||
|
.agile/
|
||||||
@ -3,8 +3,8 @@
|
|||||||
<Authors>AgileWebs</Authors>
|
<Authors>AgileWebs</Authors>
|
||||||
<Company>AgileWebs</Company>
|
<Company>AgileWebs</Company>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<RepositoryUrl>http://192.168.10.100:3000/AgileWebs/kitchen-service</RepositoryUrl>
|
<RepositoryUrl>https://gitea.dream-views.com/AgileWebs/kitchen-service</RepositoryUrl>
|
||||||
<PackageProjectUrl>http://192.168.10.100:3000/AgileWebs/kitchen-service</PackageProjectUrl>
|
<PackageProjectUrl>https://gitea.dream-views.com/AgileWebs/kitchen-service</PackageProjectUrl>
|
||||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
22
Dockerfile
Normal file
22
Dockerfile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# 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/Kitchen.Service.Grpc/Kitchen.Service.Grpc.csproj" --configfile /root/.nuget/NuGet/NuGet.Config
|
||||||
|
RUN dotnet publish "src/Kitchen.Service.Grpc/Kitchen.Service.Grpc.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", "Kitchen.Service.Grpc.dll"]
|
||||||
18
docs/roadmap/feature-epics.md
Normal file
18
docs/roadmap/feature-epics.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Feature Epics
|
||||||
|
|
||||||
|
## Repository
|
||||||
|
kitchen-service
|
||||||
|
|
||||||
|
## 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.
|
||||||
40
docs/runbooks/containerization.md
Normal file
40
docs/runbooks/containerization.md
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# Containerization Runbook
|
||||||
|
|
||||||
|
## Image Build
|
||||||
|
|
||||||
|
If the repo consumes internal packages from Gitea, pass feed credentials as build args.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build --build-arg NUGET_FEED_USERNAME=<gitea-login> --build-arg NUGET_FEED_TOKEN=<gitea-token> -t agilewebs/kitchen-service:dev .
|
||||||
|
```
|
||||||
|
|
||||||
|
## Local Run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm -p 8080:8080 --name kitchen-service agilewebs/kitchen-service:dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## Health Probe
|
||||||
|
|
||||||
|
- Path: `/health`
|
||||||
|
- Fallback path: `/healthz`
|
||||||
|
- Port: `8080`
|
||||||
|
|
||||||
|
## Runtime Notes
|
||||||
|
|
||||||
|
- Exposes internal queue and order state transition endpoints.
|
||||||
|
|
||||||
|
## 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.
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
using Kitchen.Service.Contracts.Requests;
|
||||||
|
using Kitchen.Service.Contracts.Responses;
|
||||||
|
|
||||||
|
namespace Kitchen.Service.Application.UseCases;
|
||||||
|
|
||||||
|
public interface ITransitionKitchenOrderStateUseCase
|
||||||
|
{
|
||||||
|
Task<TransitionKitchenOrderStateResponse> HandleAsync(
|
||||||
|
TransitionKitchenOrderStateRequest request,
|
||||||
|
CancellationToken cancellationToken);
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
using Kitchen.Service.Contracts.Requests;
|
||||||
|
using Kitchen.Service.Contracts.Responses;
|
||||||
|
|
||||||
|
namespace Kitchen.Service.Application.UseCases;
|
||||||
|
|
||||||
|
public sealed class TransitionKitchenOrderStateUseCase : ITransitionKitchenOrderStateUseCase
|
||||||
|
{
|
||||||
|
public Task<TransitionKitchenOrderStateResponse> HandleAsync(
|
||||||
|
TransitionKitchenOrderStateRequest request,
|
||||||
|
CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var previous = "Queued";
|
||||||
|
var allowed = request.TargetState is "Preparing" or "ReadyForPickup" or "Canceled";
|
||||||
|
|
||||||
|
return Task.FromResult(new TransitionKitchenOrderStateResponse(
|
||||||
|
request.OrderId,
|
||||||
|
request.TicketId,
|
||||||
|
previous,
|
||||||
|
allowed ? request.TargetState : previous,
|
||||||
|
allowed,
|
||||||
|
allowed ? null : "Target state is not allowed by kitchen-service policy."));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
namespace Kitchen.Service.Contracts.Requests;
|
||||||
|
|
||||||
|
public sealed record TransitionKitchenOrderStateRequest(
|
||||||
|
string OrderId,
|
||||||
|
string TicketId,
|
||||||
|
string TargetState,
|
||||||
|
string RequestedBy);
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
namespace Kitchen.Service.Contracts.Responses;
|
||||||
|
|
||||||
|
public sealed record TransitionKitchenOrderStateResponse(
|
||||||
|
string OrderId,
|
||||||
|
string TicketId,
|
||||||
|
string PreviousState,
|
||||||
|
string CurrentState,
|
||||||
|
bool Applied,
|
||||||
|
string? RejectionReason);
|
||||||
@ -5,6 +5,7 @@ using Kitchen.Service.Contracts.Requests;
|
|||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
builder.Services.AddSingleton<IKitchenQueueReadPort, DefaultKitchenQueueReadPort>();
|
builder.Services.AddSingleton<IKitchenQueueReadPort, DefaultKitchenQueueReadPort>();
|
||||||
builder.Services.AddSingleton<IGetKitchenQueueUseCase, GetKitchenQueueUseCase>();
|
builder.Services.AddSingleton<IGetKitchenQueueUseCase, GetKitchenQueueUseCase>();
|
||||||
|
builder.Services.AddSingleton<ITransitionKitchenOrderStateUseCase, TransitionKitchenOrderStateUseCase>();
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
@ -14,4 +15,15 @@ app.MapGet("/internal/kitchen/queue", async (string queueName, int? limit, IGetK
|
|||||||
return Results.Ok(await useCase.HandleAsync(request, ct));
|
return Results.Ok(await useCase.HandleAsync(request, ct));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.MapPost("/internal/kitchen/orders/transition", async (
|
||||||
|
TransitionKitchenOrderStateRequest request,
|
||||||
|
ITransitionKitchenOrderStateUseCase useCase,
|
||||||
|
CancellationToken ct) =>
|
||||||
|
{
|
||||||
|
return Results.Ok(await useCase.HandleAsync(request, ct));
|
||||||
|
});
|
||||||
|
|
||||||
|
app.MapGet("/health", () => Results.Ok(new { status = "ok", service = "kitchen-service" }));
|
||||||
|
app.MapGet("/healthz", () => Results.Ok(new { status = "ok", service = "kitchen-service" }));
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user