Files
db-subclass-to-dto/src/After/DiscountedOrder.cs
T
2026-09-16 18:40:34 +01:00

27 lines
1.0 KiB
C#

namespace After;
/// <summary>
/// The result of discounting an <see cref="Order"/>: a separate domain type,
/// not a modified order. The discount is derived data — computed on demand,
/// correlated to its order by <see cref="OrderId"/>. What a caller does with
/// it (and what of it ever reaches <see cref="OrderDto"/> or
/// <see cref="OrderData"/>) is deliberately left to the caller.
/// </summary>
public sealed record DiscountedOrder
{
/// <summary>Primary key of the discounted <see cref="Order"/>.</summary>
public Guid OrderId { get; init; }
/// <summary>The order's total in cents, as read from it (the untouched input).</summary>
public int TotalInCents { get; init; }
/// <summary>
/// The percentage actually applied, as an integer percent. 0 when the
/// order did not pass the discount barrier.
/// </summary>
public int DiscountPercentage { get; init; }
/// <summary>The total after the discount, in cents.</summary>
public int DiscountedTotalInCents { get; init; }
}