Add InPreparation intermediate state to kitchen item workflow#52
Draft
Add InPreparation intermediate state to kitchen item workflow#52
Conversation
Co-authored-by: marc-mueller <13311299+marc-mueller@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add 'In Preparation' state for kitchen items
Add InPreparation intermediate state to kitchen item workflow
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kitchen items previously only had two states (
AwaitingPreparation→Finished), making it impossible for cooks to signal that work has started on an item. This addsInPreparationas an intermediate state with a fullAwaitingPreparation → InPreparation → Finishedtransition chain.Backend (KitchenService)
InPreparation = 1toKitchenOrderItemStateandKitchenOrderItemDtoStatewith explicit ordinal values to preserve cast-based DTO conversionStartedAt: DateTimeOffset?toKitchenOrderItemandKitchenOrderItemDto; mapped inDtoConverterKitchenItemInPreparationEvent+FastFoodConstants.EventNames.KitchenItemInPreparation = "kitcheniteminpreparation"+ dead letter constantSetItemAsInPreparation(Guid id): Validates state isAwaitingPreparation, setsState = InPreparation, stampsStartedAt, publisheskitcheniteminpreparationeventSetItemAsFinished: Now requiresInPreparationstate (rejectsAwaitingPreparation); usesStartedAtfor preparation duration metricGetPendingOrders/GetPendingItems: IncludeInPreparationitems (not yet finished)POST api/kitchenwork/iteminpreparation/{id}kitcheniteminpreparationinDeadLetterHandlerControllerFrontend proxy (FrontendKitchenMonitor ASP.NET host)
POST api/kitchenwork/iteminpreparation/{id}→ Dapr invoke to KitchenServiceFrontendKitchenMonitorEventHandlerControllersubscribes tokitcheniteminpreparationtopic and broadcastskitchenorderupdatedvia SignalRFrontend Vue (FrontendKitchenMonitor SPA)
apiClient.js:startOrderItemPreparation(itemId)→POST /api/kitchenwork/iteminpreparation/${itemId}kitchenStore.js:startOrderItemPreparationactionWorkMonitor.vue: Three-state rendering with correct sort order (Awaiting → InPreparation → Finished):Dark mode classes added to all new and updated UI elements.
Tests
KitchenServiceTests: UpdatedSetItemAsFinishedtests to transition throughInPreparationfirst; added tests forSetItemAsInPreparation(happy path, already in-preparation, already finished, not found) andSetItemAsFinishedonAwaitingPreparationitem (invalid transition)KitchenWorkControllerTests(both KitchenService and FrontendKitchenMonitor): Tests for newiteminpreparationendpointFrontendKitchenMonitorEventHandlerControllerTests: New test file forkitcheniteminpreparationsubscription handlerkitchenStore.test.js: Test forstartOrderItemPreparationactionWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
registry.npmmirror.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/_temp/ghcca-node/node/bin/npm install(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/_temp/ghcca-node/node/bin/npm install 53 -j ACCEPT(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/_temp/ghcca-node/node/bin/npm install --prefer-offline(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
[DEMO] Kitchen Items: Add "In Preparation" intermediate state between "Awaiting Preparation" and "Finished"
Work Item Details
Note: Please focus on the descriptions and information that provide context about the task requirements, functionality, and implementation details. Dates, priorities, and administrative metadata are less relevant for coding tasks.
Description
Currently, kitchen items in the FrontendKitchenMonitor and KitchenService only support two states: AwaitingPreparation and Finished. A cook can only mark an item as finished — there is no way to indicate that preparation has started. This makes it impossible for other cooks to see which items are already being worked on, leading to potential double-work or confusion during busy periods.
This work item introduces a new InPreparation state between
AwaitingPreparationandFinished. A cook will first click a "Start" button to claim an item (transitioning it toInPreparation), and then click "Finish" when done. The state transition chain becomes:AwaitingPreparation → InPreparation → Finished
Scope: KitchenService backend + FrontendKitchenMonitor frontend only. The OrderService and FrontendCustomerOrderStatus are not in scope — the OrderService continues to consume only the existing
kitchenitemfinishedevent.Backend Changes (KitchenService)
Add
InPreparationvalue toKitchenOrderItemStateenum in KitchenOrderItemState.cs — insert betweenAwaitingPreparation(0) andFinished. Assign explicit ordinal values to all members to avoid breaking the DTO cast.Add
InPreparationvalue toKitchenOrderItemDtoStateenum in KitchenOrderItemDtoState.cs — matching ordinal to the entity enum.Add
StartedAtproperty toKitchenOrderItementity in KitchenOrderItem.cs — nullableDateTimeOffset?to record when preparation started, consistent with existingCreatedAt/FinishedAtpattern.Add
StartedAtproperty toKitchenOrderItemDtoin KitchenOrderItemDto.cs and update the DtoConverter to map it.Add new
SetItemAsInPreparation(Guid id)method to IKitchenService and implement in KitchenService.cs:_mockStorageAwaitingPreparation(throwInvalidOperationExceptionotherwise)State = InPreparation,StartedAt = DateTimeOffset.UtcNowkitcheniteminpreparationDapr pub/sub eventUpdate
SetItemAsFinishedin KitchenService.cs — validate that item is inInPreparationstate (notAwaitingPreparation) before allowing finish. Record observability metric for preparation duration usingStartedAt.Add new
KitchenItemInPreparationEventclass in KitchenService.Common/Events/ — matching the pattern ofKitchenItemFinishedEventwithOrderIdandItemIdproperties.Add new event name constant
KitchenItemInPreparation="kitcheniteminpreparation"to FastFoodConstants.EventNames.Add dead letter constant
DeadLetterKitchenItemInPreparationinFastFoodConstants.EventNamesand add handler in DeadLetterHandlerController.cs.Add new endpoint
POST api/kitchenwork/iteminpreparation/{id}to KitchenWorkController that callsSetItemAsInPreparation.Update
GetPendingOrders/GetPendingItemsin KitchenService.cs — items withInPreparationstate should still be included in pending results (they are not finished yet).Update backend unit tests:
* KitchenServiceTests.cs — add tests for
SetItemAsInPreparation...Work item: AB#361
Created via Azure DevOps
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.