Mango.Nop.Libraries/Mango.Nop.Core/Entities/MgStockTakingItem.cs

41 lines
1.3 KiB
C#

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<TStockTaking, TProduct> : 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; }
}