T1(customer): add domain entities, Gender enum, and ICustomerService interface#55
Conversation
🤖 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:
|
|
|
||
| namespace Customer.Domain.Entities; | ||
|
|
||
| public class Customer |
There was a problem hiding this comment.
🚩 Class name collides with root namespace, may cause resolution issues downstream
The entity class Customer lives in namespace Customer.Domain.Entities, meaning the fully qualified name is Customer.Domain.Entities.Customer. The root namespace of the project is also Customer. This name collision is already handled in ICustomerService.cs via the Entities.Customer qualifier, but downstream consumers (in Customer.Infrastructure or Customer.API) may encounter ambiguity when they try to reference the entity — the compiler could confuse the namespace Customer with the class Customer. This is a known C# pitfall when a type shares its name with its containing namespace hierarchy. It may require global:: qualifiers or aliases in future code.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Acknowledged — the class/namespace collision is a known C# pitfall here. The entity name Customer follows the project's domain naming convention. Disambiguation is already applied in ICustomerService.cs via Entities.Customer. Downstream consumers in Customer.Infrastructure and Customer.API can use the same Entities.Customer qualifier (or a using alias) if needed.
Summary
Adds the foundation domain layer for the Customer microservice — pure types with zero business logic and no cross-context references.
New files:
Customer.Domain/Entities/Customer.cs— domain entity with identity, contact, audit, andGenderpropertiesCustomer.Domain/Enums/Gender.cs—enum Gender { None, Female, Male }Customer.Domain/Interfaces/ICustomerService.cs— async CRUD contract (GetAllAsync,GetByIdAsync,CreateAsync,UpdateAsync,DeleteAsync)Genderis resolved fromCustomer.Domain.Enums; interface methods reference the entity viaEntities.Customerto disambiguate from the rootCustomernamespace.Removed
.gitkeepplaceholders fromEntities/andInterfaces/.Validated:
dotnet build Customer.Domain.csproj -c Releaseanddotnet build Customer.API.csproj -c Releaseboth succeed. Zero forbidden references (Order,Product,ApplicationUser,ApplicationDbContext).Part of the Customer microservice carve-out stacked PR chain (T1/T5).
Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/df4fd98794c34738bf5a70c588276dcb
Requested by: @mbatchelor81