namespace Distribution.Features.Grn; public interface IGrnRepository { Task GetByIdAsync(Guid id); Task> GetAllAsync(Guid? purchaseOrderId, int page, int pageSize); Task GetCountAsync(Guid? purchaseOrderId); Task> GetByPurchaseOrderIdAsync(Guid purchaseOrderId); Task AddAsync(Models.GoodsReceipt entity); /// True if at least one GoodsReceipt exists against this Po (createPurchaseReturn guard). Task HasAnyForPurchaseOrderAsync(Guid purchaseOrderId); /// Sum of AcceptedQuantity per ItemId across all receipts for a Po. Task> GetAcceptedTotalsByItemAsync(Guid purchaseOrderId); }