using LinqToDB.Mapping; using Mango.Nop.Core.Entities; namespace FruitBank.Common.Entities; [Table(Name = FruitBankConstClient.StockTakingDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.StockTakingDbTableName)] public class StockTaking : MgStockTaking { public override bool IsReadyForClose() { if (StockTakingItems == null || StockTakingItems.Count == 0) return false; return StockTakingItems.Where(stockTakingItem => stockTakingItem is { IsRequiredForMeasuring: true, IsInvalid: false }).All(x => x.IsMeasured); } }