33 lines
1.2 KiB
C#
33 lines
1.2 KiB
C#
namespace After;
|
|
|
|
/// <summary>
|
|
/// An order as a plain domain object: no <see cref="DbBase"/> inheritance, no
|
|
/// knowledge of <see cref="DbContext"/>. Its data travels to the WebApp as an
|
|
/// <see cref="OrderDto"/>.
|
|
/// </summary>
|
|
public class Order
|
|
{
|
|
/// <summary>
|
|
/// Primary key as a plain value: <see cref="Guid.Empty"/> until a
|
|
/// <see cref="DbContext"/> explicitly saves this order (which copies a
|
|
/// generated id in).
|
|
/// </summary>
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>Free-text description of what this order is for.</summary>
|
|
public string Description { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Order total in cents (integer — no floating-point money). A normal
|
|
/// attribute: it is persisted in <see cref="OrderData"/> and mapped
|
|
/// one-on-one into <see cref="OrderDto.TotalInCents"/>.
|
|
/// </summary>
|
|
public int TotalInCents { get; set; }
|
|
|
|
/// <summary>
|
|
/// The client that owns this order. Set automatically by
|
|
/// <see cref="ClientOrders"/> when the order is added to
|
|
/// <see cref="Client.Orders"/> (navigation fix-up).
|
|
/// </summary>
|
|
public Client? Client { get; set; }
|
|
} |