Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
18 changes: 18 additions & 0 deletions src/Services/Customer/Customer.Domain/Entities/Customer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Customer.Domain.Enums;

namespace Customer.Domain.Entities;

public class Customer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

{
public int Id { get; set; }
public required string Name { get; set; }
public required string Email { get; set; }
public string? PhoneNumber { get; set; }
public string? Address { get; set; }
public string? City { get; set; }
public Gender Gender { get; set; }
public string? CreatedBy { get; set; }
public string? UpdatedBy { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime UpdatedDate { get; set; }
}
8 changes: 8 additions & 0 deletions src/Services/Customer/Customer.Domain/Enums/Gender.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Customer.Domain.Enums;

public enum Gender
{
None = 0,
Female = 1,
Male = 2
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Customer.Domain.Interfaces;

public interface ICustomerService
{
Task<IEnumerable<Entities.Customer>> GetAllAsync();
Task<Entities.Customer?> GetByIdAsync(int id);
Task<Entities.Customer> CreateAsync(Entities.Customer customer);
Task UpdateAsync(Entities.Customer customer);
Task<bool> DeleteAsync(int id);
}