Enhance ToonDescription docs for PreOrder entities
Expanded and clarified ToonDescription attributes for PreOrder and PreOrderItem classes. Added business rules, constraints, and improved property-level documentation to better describe allocation, conversion, and status logic. No functional changes.
This commit is contained in:
parent
98799a79e1
commit
c9b0bf8334
File diff suppressed because one or more lines are too long
|
|
@ -12,18 +12,24 @@ namespace FruitBank.Common.Entities;
|
||||||
[ToonDescription("Single product line of a customer preorder with fulfilment tracking", Purpose = "A requested product line within a PreOrder. Tracks requested versus cumulatively fulfilled quantity as incoming stock is allocated across one or more shipping-document conversion runs.")]
|
[ToonDescription("Single product line of a customer preorder with fulfilment tracking", Purpose = "A requested product line within a PreOrder. Tracks requested versus cumulatively fulfilled quantity as incoming stock is allocated across one or more shipping-document conversion runs.")]
|
||||||
public sealed class PreOrderItem : MgEntityBase
|
public sealed class PreOrderItem : MgEntityBase
|
||||||
{
|
{
|
||||||
|
[ToonDescription(Purpose = "FK to the parent PreOrder.")]
|
||||||
public int PreOrderId { get; set; }
|
public int PreOrderId { get; set; }
|
||||||
|
|
||||||
|
[ToonDescription(Purpose = "FK to the nopCommerce Product being preordered.")]
|
||||||
public int ProductId { get; set; }
|
public int ProductId { get; set; }
|
||||||
|
|
||||||
[ToonDescription(Purpose = "Quantity of the product the customer requested.")]
|
[ToonDescription(Purpose = "Quantity of the product the customer requested.", Constraints = "positive")]
|
||||||
public int RequestedQuantity { get; set; }
|
public int RequestedQuantity { get; set; }
|
||||||
|
|
||||||
[ToonDescription(Purpose = "Quantity allocated from incoming stock so far; accumulates across conversion runs until it reaches RequestedQuantity.")]
|
[ToonDescription(Purpose = "Quantity allocated from incoming stock so far; accumulates across conversion runs until it reaches RequestedQuantity.",
|
||||||
|
BusinessRule = "this >= 0 && this <= RequestedQuantity")]
|
||||||
public int FulfilledQuantity { get; set; }
|
public int FulfilledQuantity { get; set; }
|
||||||
|
|
||||||
[ToonDescription(Purpose = "Gross unit price locked at preorder time. Used as the order-item price on conversion for non-measurable products; measurable products are priced 0 at conversion and weighed afterwards.")]
|
[ToonDescription(Purpose = "Gross unit price locked at preorder time. Used as the order-item price on conversion for non-measurable products; measurable products are priced 0 at conversion and weighed afterwards.",
|
||||||
|
Constraints = "non-negative")]
|
||||||
public decimal UnitPriceInclTax { get; set; }
|
public decimal UnitPriceInclTax { get; set; }
|
||||||
|
|
||||||
[ToonDescription(Purpose = "Item lifecycle: Pending -> Fulfilled (fully allocated) / PartiallyFulfilled (partly allocated) / Dropped (expired or no incoming stock).")]
|
[ToonDescription(Purpose = "Item lifecycle: Pending / Fulfilled (fully allocated) / PartiallyFulfilled (partly allocated) / Dropped (expired or no incoming stock).",
|
||||||
|
BusinessRule = "set during conversion: FulfilledQuantity >= RequestedQuantity ? Fulfilled : FulfilledQuantity > 0 ? PartiallyFulfilled : Dropped; stays Pending until first allocation")]
|
||||||
public PreOrderItemStatus Status { get; set; }
|
public PreOrderItemStatus Status { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue