using AyCode.Interfaces.Entities; using AyCode.Interfaces.TimeStampInfo; using LinqToDB; using LinqToDB.Mapping; using Mango.Nop.Core.Dtos; using Mango.Nop.Core.Interfaces; namespace Mango.Nop.Core.Entities; public interface IMgStockTakingItem : IEntityInt, ITimeStampInfo { public int StockTakingId { get; set; } public int ProductId { get; set; } public bool IsMeasured { get; set; } public int OriginalStockQuantity { get; set; } public int MeasuredStockQuantity { get; set; } } public abstract class MgStockTakingItem : MgEntityBase, IMgStockTakingItem where TStockTaking : class, IMgStockTaking where TProduct : class, IMgProductDto { public int StockTakingId { get; set; } public int ProductId { get; set; } public bool IsMeasured { get; set; } public int OriginalStockQuantity { get; set; } public int MeasuredStockQuantity { get; set; } [Association(ThisKey = nameof(StockTakingId), OtherKey = nameof(IMgStockTaking.Id), CanBeNull = true)] public TStockTaking? StockTaking{ get; set; } [Association(ThisKey = nameof(ProductId), OtherKey = nameof(IMgProductDto.Id), CanBeNull = true)] public TProduct? Product { get; set; } public DateTime Created { get; set; } public DateTime Modified { get; set; } }