Extract Customer bounded context into the Customer service - #88
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This was referenced Sep 10, 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.
Summary
Implements
src/Services/Customerby porting the monolith's customer bounded context, keeping the wire shape identical to the monolith'sCustomerVMso the Angular client can be repointed at the gateway without changes.Domain owns customer fields only; the customer↔order link is an ID-only join row, so nothing in this service references an
Ordertype:CustomerRepository.GetAllCustomersDataAsyncreproduces the monolith'sGetAllCustomersData(Include(OrderRefs).AsSingleQuery().OrderBy(Name)), minus the Order/OrderDetail/Product/Cashier graph that no longer lives here.GetTopActiveCustomersAsync(count)—NotImplementedExceptionin the monolith — ranks byOrderRefs.Countdescending, then name. The controller fills in the verbs the monolith stubbed out (GET /{id},POST,PUT,DELETE) with the monolith validator's rules (name required, gender required and parseable) and returns/acceptsCustomerVM;OrderVMentries carry onlyId(discount/commentsstay at defaults since those fields are order-owned).The controller is routed twice on purpose — the gateway strips
/api/customersbefore forwarding, so it serves at both the service root and/api/customersfor direct calls:Startup applies the EF migration and seeds the monolith's demo customers (idempotent), retrying while Postgres comes up, so
GET /api/customersreturns data on a fresh compose volume.Repo fixes needed to make the stack build and boot: Identity/Notification/Order/Product
.APIprojects referenced..\..\Shared\...(one..short, silently unresolved — Notification failed to compile); all now use..\..\..\Shared\....Tests:
Customer.Tests(xUnit, added to the solution) runs characterization tests for the read path, CRUD, top-active, VM shape and the ID-only order representation against Postgres via Testcontainers, falling back to the EF in-memory provider when Docker is unavailable. Verified green on both paths (15/15).Verified end-to-end with
docker compose -f src/docker-compose.yml up --build:curl localhost:5000/api/customersreturns the seeded customers through YARP, andGET /{id},top-active/{count},POST,PUT,DELETEall behave through the gateway.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/303c0deaab44431b977996c037eb49eb
Open in Devin Desktop: https://partner-workshops.devinenterprise.com/desktop/session/303c0deaab44431b977996c037eb49eb?variant=devin
Requested by: @DhrovS