Add Order Service — Place Order, CI/CD#81
Open
npcjake wants to merge 23 commits into
Open
Conversation
10 xUnit tests covering MapOrderTypeToItems (food/beverage/package/unknown), PlaceOrderAsync status logic (Assigned/Pending), and GeocodeAddressAsync fallback to downtown Spokane when Nominatim is unavailable or returns no results. Uses EF Core InMemory and fake HTTP handler — no external dependencies needed.
Replaced shared deliverybotsystem-sql (William-admin) with jacob-orderservice-sql2 where jtonani1 is AAD admin. deliverybot-order-service managed identity is already granted db_owner on OrderServiceDb. Also fixed BotNetApi URL placeholder in workflow. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Issue #43 requires tests run before pushing image. Fails fast if any test fails. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jenny-curry
reviewed
May 28, 2026
Collaborator
jenny-curry
left a comment
There was a problem hiding this comment.
I would create a new OrderService folder and put your two existing OrderService folders into it in order to keep the file structure clean when other PRs are merged
Collaborator
There was a problem hiding this comment.
You don't need a gitignore at this level
Collaborator
There was a problem hiding this comment.
The .gitignore should be at the root level of the repository
Move OrderService and OrderService.Tests into a new OrderService/ parent dir to keep the file structure clean as other PRs merge, per review feedback. Update workflow test path and docker build context accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codify the deliverybot-order-service Container App as IaC under Iac/order-service/, using a reusable container-app module. Reuses the shared RG, Container App Environment, and ACR via data sources; the module owns the app's identity, ACR-pull auth, ingress, and env/secret configuration. Image tag stays owned by the CD pipeline (ignore_changes). Validated with terraform validate + fmt and proven against the live app via import (plan: 0 to destroy). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Provision the Container App via `terraform apply` before building and rolling out the image, matching the team's admin-webapp pipeline pattern. Terraform now owns the app's env vars/secrets, so the image-update step only bumps the image tag (dropped --set-env-vars to avoid drift). Add an import block so CI adopts the pre-existing app into remote state on the first apply (removable afterward). Workflow also triggers on Iac/order-service changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Iterate the non-sensitive secret names and look up values, instead of passing the sensitive secrets map directly to for_each — which TF 1.9.x rejects (the CI runner's version). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The CI service principal is RG-scoped and lacks subscription-level provider registration rights (403). Providers are already registered, so set resource_provider_registrations = "none". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Separate concerns: orderservice-iac.yml runs Terraform (plan on PR, apply on merge to main), triggered by Iac/order-service changes. orderservice-deploy.yml now only builds/pushes the image and rolls it out, triggered by OrderService code changes. Terraform owns env/secrets. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move UseSwagger/UseSwaggerUI out of the Development-only block so the deployed API can be explored and tested from the browser at /swagger. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Closes #40, #43
Partial #41, #42
What's included
API endpoints (
OrderService/)POST /api/orders— Place an order. Geocodes the delivery address via Nominatim, selects an available bot from BotNetApi, saves to Azure SQL, publishes aRobotOrderAssignmentevent to therobot-inputEvent Hub.GET /api/orders/{id}— Get order status by order ID.GET /api/orders?customerId={id}— Order history.customerIdis formatted as"CustomerName:Phone"— whoever wires up the frontend history page will need to know this.Infrastructure
jacob-orderservice-sql2.database.windows.net / OrderServiceDb). Managed Identity auth —deliverybot-order-serviceis already granteddb_owner. Schema is created automatically on first startup viaDatabase.Migrate().CI/CD (
.github/workflows/orderservice-deploy.yml)mainwith changes underOrderService/**deliverybotcr.azurecr.io→ deploys todeliverybot-order-serviceContainer AppTests (
OrderService.Tests/)Known gaps
#41 and #42 are partially complete. The endpoints exist, are fully wired up, and return real data — the skeleton is done. However, order status will always reflect what it was at placement (
PendingorAssigned) because updating status requires consuming bot telemetry events from the Event Hub, which depends on the read model work (#64–#70). Once those events are being published, the Order Service will need a consumer to update order status toInTransitorDelivered.