Skip to content

Add Order Service — Place Order, CI/CD#81

Open
npcjake wants to merge 16 commits into
mainfrom
order-service
Open

Add Order Service — Place Order, CI/CD#81
npcjake wants to merge 16 commits into
mainfrom
order-service

Conversation

@npcjake
Copy link
Copy Markdown

@npcjake npcjake commented May 26, 2026

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 a RobotOrderAssignment event to the robot-input Event Hub.
  • GET /api/orders/{id} — Get order status by order ID.
  • GET /api/orders?customerId={id} — Order history. customerId is formatted as "CustomerName:Phone" — whoever wires up the frontend history page will need to know this.

Infrastructure

  • EF Core + Azure SQL (jacob-orderservice-sql2.database.windows.net / OrderServiceDb). Managed Identity auth — deliverybot-order-service is already granted db_owner. Schema is created automatically on first startup via Database.Migrate().
  • Dockerfile (multi-stage, same pattern as BotNetApi)

CI/CD (.github/workflows/orderservice-deploy.yml)

  • Triggers on push to main with changes under OrderService/**
  • Runs unit tests → builds Docker image → pushes to deliverybotcr.azurecr.io → deploys to deliverybot-order-service Container App
  • Event Hub connection string injected via GitHub secret at deploy time

Tests (OrderService.Tests/)

  • Unit tests covering Place Order, Get Order, and Order History logic

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 (Pending or Assigned) 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 to InTransit or Delivered.

npcjake and others added 12 commits May 25, 2026 13:38
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>
@npcjake npcjake marked this pull request as draft May 26, 2026 22:06
@npcjake npcjake marked this pull request as ready for review May 26, 2026 22:07
@npcjake npcjake linked an issue May 26, 2026 that may be closed by this pull request
@philspokas philspokas self-requested a review May 26, 2026 22:31
@npcjake npcjake changed the title Add Order Service — Place Order, Get Status, Order History, CI/CD Add Order Service — Place Order, CI/CD May 26, 2026
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.

Order Service CI/CD Pipeline Place an Order

1 participant