feat(domain): ProductPrice entity + exceptions (PRD-003)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
namespace SIGCM2.Domain.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Thrown when no ProductPrice row covers the requested date for the given product. → HTTP 404
|
||||
/// Consumers of IProductPricingService may throw this when GetPriceAtAsync returns null.
|
||||
/// </summary>
|
||||
public sealed class ProductSinPrecioActivoException : DomainException
|
||||
{
|
||||
public int ProductId { get; }
|
||||
public DateOnly Date { get; }
|
||||
|
||||
public ProductSinPrecioActivoException(int productId, DateOnly date)
|
||||
: base($"No existe precio registrado para el producto {productId} aplicable a la fecha {date:yyyy-MM-dd}.")
|
||||
{
|
||||
ProductId = productId;
|
||||
Date = date;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user