Skip to content

Add OrderQueueService for real-time wait time estimation#25

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-order-queue-service
Draft

Add OrderQueueService for real-time wait time estimation#25
Copilot wants to merge 2 commits intomainfrom
copilot/add-order-queue-service

Conversation

Copy link

Copilot AI commented Mar 13, 2026

Adds an in-memory order queue to the backend so store management can track active orders and customers can see estimated wait times based on current order volume and historical preparation data.

New Components

  • OrderQueueEntry model — tracks OrderId, EnqueuedAt, CompletedAt, Status (Pending/Completed), and computes PreparationTimeMinutes
  • OrderQueueService (singleton) — thread-safe in-memory queue; retains up to 100 completed entries for rolling average calculation; defaults to 5-minute prep time when no history exists
  • OrderQueueController — four new endpoints:
Method Route Description
GET /api/orderqueue/status Pending count + estimated wait + avg prep time
GET /api/orderqueue/averagetime Average preparation time in minutes
GET /api/orderqueue All queue entries (pending + completed)
POST /api/orderqueue/{orderId}/complete Mark order complete, records actual prep time

Modified

  • OrderService.CreateOrderAsync — automatically enqueues every new order after DB save
  • Program.cs — registers OrderQueueService as a singleton

Example Response — GET /api/orderqueue/status

{
  "pendingOrderCount": 3,
  "averagePreparationTimeMinutes": 4.7,
  "estimatedWaitMinutes": 14.1
}

Estimated wait is pendingCount × avgPrepTime — appropriate for a single-station preparation model.

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.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@PagelsR
Copy link
Owner

PagelsR commented Mar 13, 2026

@copilot after I delegate to the cloud, I do not want updates in chat. How to turn this off?

…wait times

Co-authored-by: PagelsR <4490855+PagelsR@users.noreply.github.com>
Copilot AI changed the title [WIP] Add order queue implementation for tracking order preparation times Add OrderQueueService for real-time wait time estimation Mar 13, 2026
Copilot AI requested a review from PagelsR March 13, 2026 16:19
Copy link
Author

Copilot AI commented Mar 13, 2026

@copilot after I delegate to the cloud, I do not want updates in chat. How to turn this off?

To stop receiving in-chat update notifications after delegating to the Copilot coding agent, you can mute notifications for the PR:

  1. On the PR page, click Unsubscribe in the right-hand "Notifications" panel, or
  2. Click the bell icon at the top of the conversation and select "Ignore" to mute all notifications for that PR.

Alternatively, to reduce GitHub notification emails globally, go to GitHub Settings → Notifications and adjust your preferences for pull request activity.

There is currently no way to prevent the agent from posting progress comments to the PR itself — that's how it communicates status — but muting the PR notifications means you won't be pinged for each update.

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