fix(kitchen-ops-bff): report kitchen transition success
This commit is contained in:
parent
6d4251b3b3
commit
deea1f260d
@ -33,4 +33,5 @@ This BFF exposes kitchen board, claim or release, transition, and priority workf
|
||||
- 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`.
|
||||
- Transition success at the edge is now sourced from the upstream `Applied` flag so operators see truthful mutation outcomes.
|
||||
- Correlation IDs are preserved through Thalos session checks and kitchen-service calls.
|
||||
|
||||
@ -89,13 +89,15 @@ public sealed class KitchenWorkflowServiceClient(HttpClient httpClient) : IKitch
|
||||
throw new InvalidOperationException("Kitchen service returned an empty transition payload.");
|
||||
}
|
||||
|
||||
// kitchen-service reports success as `Applied`; the public edge contract exposes
|
||||
// the same outcome as `Transitioned` for the web clients.
|
||||
return new TransitionKitchenWorkItemResponse(
|
||||
payload.OrderId,
|
||||
payload.TicketId,
|
||||
MapEdgeState(payload.PreviousState),
|
||||
MapEdgeState(payload.CurrentState),
|
||||
payload.Transitioned,
|
||||
payload.Error);
|
||||
payload.Applied,
|
||||
payload.RejectionReason);
|
||||
}
|
||||
|
||||
public async Task<SetKitchenOrderPriorityResponse> SetOrderPriorityAsync(SetKitchenOrderPriorityRequest request, CancellationToken cancellationToken)
|
||||
@ -186,8 +188,8 @@ public sealed class KitchenWorkflowServiceClient(HttpClient httpClient) : IKitch
|
||||
string TicketId,
|
||||
string PreviousState,
|
||||
string CurrentState,
|
||||
bool Transitioned,
|
||||
string? Error);
|
||||
bool Applied,
|
||||
string? RejectionReason);
|
||||
|
||||
private sealed record UpdateKitchenPriorityPayload(
|
||||
string ContextId,
|
||||
|
||||
@ -69,8 +69,8 @@ public sealed class KitchenWorkflowServiceClientTests
|
||||
"ticketId": "KT-1001",
|
||||
"previousState": "Queued",
|
||||
"currentState": "Preparing",
|
||||
"transitioned": true,
|
||||
"error": null
|
||||
"applied": true,
|
||||
"rejectionReason": null
|
||||
}
|
||||
"""));
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user