Skip to content

Add OrderQueueService with estimated wait-time endpoints#27

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/vscode-mmp6uwwn-rmls
Draft

Add OrderQueueService with estimated wait-time endpoints#27
Copilot wants to merge 2 commits intomainfrom
copilot/vscode-mmp6uwwn-rmls

Conversation

Copy link

Copilot AI commented Mar 13, 2026

Adds an in-memory order queue to the backend so store staff and waiting customers can see current queue depth and estimated wait times based on real order history.

New

  • OrderQueueEntry model — tracks OrderId, QueuedAt, CompletedAt, Status (Queued / InProgress / Completed), and a computed PrepTimeMinutes
  • OrderQueueService (singleton) — thread-safe ConcurrentDictionary-backed queue; exposes:
    • EnqueueOrder / CompleteOrder
    • GetPendingOrderCount / GetAveragePrepTimeMinutes / GetEstimatedWaitMinutes
  • OrderQueueController — three endpoints:
Method Route Description
GET /api/orderqueue/status Pending count, estimated wait, avg prep time
GET /api/orderqueue/average-prep-time Avg prep time; 204 until first completion
POST /api/orderqueue/{id}/complete Mark order done, record its prep time
  • QueueStatusResponse / AveragePrepTimeResponse DTOs in Models/

Modified

  • OrderService.CreateOrderAsync — calls EnqueueOrder after persisting each new order
  • Program.cs — registers OrderQueueService as a singleton

Estimation logic

estimatedWait = pendingOrderCount × avgPrepTimeMinutes

Defaults to 5 min/order until completion history is available.

Original prompt

Add a small queue implementation to the backend to track order preparation times for store management. This will allow people that are waiting for their orders to see estimated wait times based on current order volume.

  • Show me the design and implementation plan Todo list.
  • Implement the backend OrderQueueService to track order times.
  • Create API endpoints to get current queue status and average preparation times.

The user has attached the following file paths as relevant context:

  • .github\instructions\copilot-instructions.instructions.md

Created from VS Code.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: PagelsR <4490855+PagelsR@users.noreply.github.com>
Copilot AI changed the title [WIP] Add queue implementation for tracking order preparation times Add OrderQueueService with estimated wait-time endpoints Mar 13, 2026
Copilot AI requested a review from PagelsR March 13, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants