using AyCode.Core.Serializers.Attributes; using AyCode.Core.Serializers.Toons; using FruitBank.Common.Interfaces; using LinqToDB.Mapping; using Mango.Nop.Core.Entities; using System.Collections.ObjectModel; namespace FruitBank.Common.Entities; [AcBinarySerializable(false, true, false, true, false, false)] [ToonDescription("Shipping document with partner, items and files", Purpose = "A digital representation of a supplier's delivery note or invoice associated with the shipment, used for reconciling paper-based data with measured reality")] [Table(Name = FruitBankConstClient.ShippingDocumentDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDocumentDbTableName)] public class ShippingDocument : MgEntityBase, IShippingDocument { public int PartnerId { get; set; } public int? ShippingId { get; set; } public string DocumentIdNumber { get; set; } public string PdfFileName { get; set; } public DateTime ShippingDate { get; set; } = DateTime.Now; public string Country { get; set; } public int TotalPallets { get; set; } public bool IsAllMeasured { get; set; } public string Comment { get; set; } [Association(ThisKey = nameof(ShippingId), OtherKey = nameof(Shipping.Id), CanBeNull = true)] public Shipping? Shipping{ get; set; } [Association(ThisKey = nameof(PartnerId), OtherKey = nameof(Partner.Id), CanBeNull = true)] public Partner? Partner { get; set; } [Association(ThisKey = nameof(Id), OtherKey = nameof(ShippingItem.ShippingDocumentId), CanBeNull = true)] public List? ShippingItems { get; set; } [Association(ThisKey = nameof(Id), OtherKey = nameof(FruitBank.Common.Entities.ShippingDocumentToFiles.ShippingDocumentId), CanBeNull = true)] public List? ShippingDocumentToFiles { get; set; } [SkipValuesOnUpdate] public DateTime Created { get; set; } public DateTime Modified { get; set; } }