using AyCode.Core.Serializers.Attributes; using AyCode.Core.Serializers.Toons; using FruitBank.Common.Enums; using LinqToDB.Mapping; using Mango.Nop.Core.Entities; namespace FruitBank.Common.Entities; [AcBinarySerializable(false, true, false, true, false, false)] [Table(Name = FruitBankConstClient.PreOrderItemDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.PreOrderItemDbTableName)] [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 int PreOrderId { get; set; } public int ProductId { get; set; } [ToonDescription(Purpose = "Quantity of the product the customer requested.")] public int RequestedQuantity { get; set; } [ToonDescription(Purpose = "Quantity allocated from incoming stock so far; accumulates across conversion runs until it reaches RequestedQuantity.")] 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.")] public decimal UnitPriceInclTax { get; set; } [ToonDescription(Purpose = "Item lifecycle: Pending -> Fulfilled (fully allocated) / PartiallyFulfilled (partly allocated) / Dropped (expired or no incoming stock).")] public PreOrderItemStatus Status { get; set; } }