using FruitBank.Common.Dtos; using LinqToDB; using LinqToDB.Mapping; using Mango.Nop.Core.Entities; namespace FruitBank.Common.Entities; [Table(Name = FruitBankConstClient.StockTakingItemDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.StockTakingItemDbTableName)] public class StockTakingItem : MgStockTakingItem { [Column(DataType = DataType.DecFloat, CanBeNull = false)] public double OriginalNetWeight { get; set; } [Column(DataType = DataType.DecFloat, CanBeNull = false)] public double MeasuredNetWeight { get; set; } [Association(ThisKey = nameof(Id), OtherKey = nameof(StockTakingItemPallet.StockTakingItemId), CanBeNull = true)] public List? StockTakingItemPallets { get; set; } public bool IsRequiredForMeasuring => OriginalStockQuantity != 0 || OriginalNetWeight != 0; public string DisplayText { get { if (IsMeasured) return $"[KÉSZ] {Product!.Name}"; return IsRequiredForMeasuring ? $"[KÖT] {Product!.Name}" : $"{Product!.Name}"; } } }