feat(domain): Product entity + 5 domain exceptions (PRD-002)
This commit is contained in:
15
src/api/SIGCM2.Domain/Exceptions/ProductNotFoundException.cs
Normal file
15
src/api/SIGCM2.Domain/Exceptions/ProductNotFoundException.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace SIGCM2.Domain.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Thrown when a requested Product does not exist. → HTTP 404
|
||||
/// </summary>
|
||||
public sealed class ProductNotFoundException : DomainException
|
||||
{
|
||||
public int ProductId { get; }
|
||||
|
||||
public ProductNotFoundException(int id)
|
||||
: base($"El producto con id={id} no existe.")
|
||||
{
|
||||
ProductId = id;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user