Compare commits
No commits in common. "6d4251b3b3219b0a3423a98a55eb6e574ade1d26" and "fcaa7e0d91b8eb78fcb9f2f18f9babf508035afa" have entirely different histories.
6d4251b3b3
...
fcaa7e0d91
@ -30,7 +30,4 @@ This BFF exposes kitchen board, claim or release, transition, and priority workf
|
||||
## Notes
|
||||
|
||||
- `kitchen-service` currently exposes claim but not a dedicated release contract, so the release route reuses the claim validation path and projects a release-oriented response for the BFF edge.
|
||||
- Transition requests now forward `ContextId` to `kitchen-service` so kitchen actions land in the correct shared restaurant lifecycle context.
|
||||
- Board reads now rely on the lifecycle-driven kitchen ticket materialization in `kitchen-service`, which means newly accepted restaurant orders can appear without a stack reset.
|
||||
- The BFF keeps temporary edge-state compatibility for existing web clients by translating `Cooking|Ready|Served` to the canonical kitchen-service states `Preparing|ReadyForPickup|Delivered`.
|
||||
- Correlation IDs are preserved through Thalos session checks and kitchen-service calls.
|
||||
|
||||
@ -9,10 +9,11 @@ kitchen-ops-bff
|
||||
- Epic 3: Improve observability and operational readiness for demo compose environments.
|
||||
|
||||
## Domain-Specific Candidate Features
|
||||
- Kitchen board projection over linked restaurant tickets.
|
||||
- Kitchen work-item claim, release, transition, and priority workflows aligned with canonical kitchen-service state transitions.
|
||||
- Cross-app state continuity from customer or waiter submission through kitchen execution and POS readiness.
|
||||
- Order lifecycle consistency and state transitions.
|
||||
- Kitchen queue and dispatch optimization hooks.
|
||||
- Kitchen work-item claim, release, transition, and priority workflows aligned with kitchen-service.
|
||||
- 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.
|
||||
|
||||
@ -39,6 +39,5 @@ docker run --rm -p 8080:8080 --name kitchen-ops-bff agilewebs/kitchen-ops-bff:de
|
||||
- Integration artifact path: `greenfield/demo/restaurant/docker-compose.yml`
|
||||
## Known Limitations
|
||||
|
||||
- Kitchen-ops now delegates dashboard and work-item actions to `kitchen-service`, which projects persisted kitchen ticket state and syncs order progression back into the shared restaurant lifecycle.
|
||||
- Temporary edge-state translation remains in place for existing web clients until the Stage 47 kitchen web task adopts the canonical kitchen-service states directly.
|
||||
- Kitchen-ops now delegates dashboard and work-item actions to `kitchen-service`, but the upstream kitchen workflow adapter still serves deterministic demo data rather than database-backed state.
|
||||
- Demo PostgreSQL seeds validate integration contracts and smoke determinism, but do not yet imply full persistence implementation parity.
|
||||
|
||||
@ -75,11 +75,7 @@ public sealed class KitchenWorkflowServiceClient(HttpClient httpClient) : IKitch
|
||||
{
|
||||
using var response = await httpClient.PostAsJsonAsync(
|
||||
"internal/kitchen/orders/transition",
|
||||
new TransitionKitchenWorkItemPayload(
|
||||
request.OrderId,
|
||||
request.TicketId,
|
||||
MapKitchenServiceState(request.TargetState),
|
||||
request.ContextId ?? "demo-context"),
|
||||
new TransitionKitchenWorkItemPayload(request.OrderId, request.TicketId, request.TargetState),
|
||||
cancellationToken);
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
@ -92,8 +88,8 @@ public sealed class KitchenWorkflowServiceClient(HttpClient httpClient) : IKitch
|
||||
return new TransitionKitchenWorkItemResponse(
|
||||
payload.OrderId,
|
||||
payload.TicketId,
|
||||
MapEdgeState(payload.PreviousState),
|
||||
MapEdgeState(payload.CurrentState),
|
||||
payload.PreviousState,
|
||||
payload.CurrentState,
|
||||
payload.Transitioned,
|
||||
payload.Error);
|
||||
}
|
||||
@ -159,27 +155,7 @@ public sealed class KitchenWorkflowServiceClient(HttpClient httpClient) : IKitch
|
||||
string ClaimedBy,
|
||||
string Message);
|
||||
|
||||
private static string MapKitchenServiceState(string edgeState) => edgeState switch
|
||||
{
|
||||
"Cooking" => "Preparing",
|
||||
"Ready" => "ReadyForPickup",
|
||||
"Served" => "Delivered",
|
||||
_ => edgeState
|
||||
};
|
||||
|
||||
private static string MapEdgeState(string serviceState) => serviceState switch
|
||||
{
|
||||
"Preparing" => "Cooking",
|
||||
"ReadyForPickup" => "Ready",
|
||||
"Delivered" => "Served",
|
||||
_ => serviceState
|
||||
};
|
||||
|
||||
private sealed record TransitionKitchenWorkItemPayload(
|
||||
string OrderId,
|
||||
string TicketId,
|
||||
string TargetState,
|
||||
string ContextId);
|
||||
private sealed record TransitionKitchenWorkItemPayload(string OrderId, string TicketId, string TargetState);
|
||||
|
||||
private sealed record TransitionKitchenWorkItemResponsePayload(
|
||||
string OrderId,
|
||||
|
||||
@ -4,5 +4,4 @@ public sealed record TransitionKitchenWorkItemRequest(
|
||||
string OrderId,
|
||||
string TicketId,
|
||||
string TargetState,
|
||||
string UpdatedBy,
|
||||
string? ContextId = null);
|
||||
string UpdatedBy);
|
||||
|
||||
@ -65,7 +65,7 @@ public sealed class KitchenWorkflowServiceClientTests
|
||||
{
|
||||
var adapter = new KitchenWorkflowServiceClient(CreateClient("""
|
||||
{
|
||||
"orderId": "ORD-1001",
|
||||
"orderId": "CO-1001",
|
||||
"ticketId": "KT-1001",
|
||||
"previousState": "Queued",
|
||||
"currentState": "Preparing",
|
||||
@ -75,11 +75,11 @@ public sealed class KitchenWorkflowServiceClientTests
|
||||
"""));
|
||||
|
||||
var response = await adapter.TransitionWorkItemAsync(
|
||||
new TransitionKitchenWorkItemRequest("ORD-1001", "KT-1001", "Cooking", "chef-maya", "demo-context"),
|
||||
new TransitionKitchenWorkItemRequest("CO-1001", "KT-1001", "Preparing", "chef-maya"),
|
||||
CancellationToken.None);
|
||||
|
||||
Assert.True(response.Transitioned);
|
||||
Assert.Equal("Cooking", response.CurrentState);
|
||||
Assert.Equal("Preparing", response.CurrentState);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -124,14 +124,14 @@ public sealed class KitchenWorkflowServiceClientTests
|
||||
private const string BoardPayload = """
|
||||
{
|
||||
"contextId": "demo-context",
|
||||
"summary": "Kitchen board now reflects persisted tickets linked to shared restaurant orders.",
|
||||
"summary": "Kitchen board shows queued, preparing, and ready lanes for the current service context.",
|
||||
"lanes": [
|
||||
{
|
||||
"lane": "queued",
|
||||
"items": [
|
||||
{
|
||||
"workItemId": "WK-1001",
|
||||
"orderId": "ORD-1001",
|
||||
"orderId": "CO-1001",
|
||||
"ticketId": "KT-1001",
|
||||
"tableId": "T-08",
|
||||
"station": "hot-line",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user