public async Task <decimal> GetValue(Guid importNotificationId) { var shipment = await shipmentRepository.GetByNotificationIdOrDefault(importNotificationId); if (shipment == null) { return(0); } var numberOfShipments = shipment.NumberOfShipments; var largestNumberOfShipments = await numberOfShipmentsHistotyRepository.GetLargestNumberOfShipments(importNotificationId); if (largestNumberOfShipments > shipment.NumberOfShipments) { numberOfShipments = largestNumberOfShipments; } var notification = await notificationRepository.Get(importNotificationId); return(await GetPrice(notification, numberOfShipments, await GetInterimStatus(importNotificationId))); }