protected override async Task <IOperationResponse <GetPossibleDeliveryRoutesHandlerResponse> > HandleAsync(GetPossibleDeliveryRoutesHandlerRequest request)
        {
            var deliveryRoutes = await _deliveryRouteReadOnlyRepository.GetAllAsync();

            if (deliveryRoutes == null || !deliveryRoutes.Any())
            {
                throw new DataAccessNotFoundException(ResponseMessages.Route.DoesNotExist);
            }

            var routes        = BuildRoute(request.Route);
            var possibleRoute = CalculatePossibleDeliveryRoute(routes, request.MaxRouteRepeat, request.MaxDeliveryCost, request.MaxStop, deliveryRoutes);

            return(Success(new GetPossibleDeliveryRoutesHandlerResponse(possibleRoute)));
        }
        protected override async Task <IOperationResponse <GetTheCheapestDeliveryCostHandlerResponse> > HandleAsync(GetTheCheapestDeliveryCostHandlerRequest request)
        {
            var deliveryRoutes = await _deliveryRouteReadOnlyRepository.GetAllAsync();

            if (deliveryRoutes == null || !deliveryRoutes.Any())
            {
                throw new DataAccessNotFoundException(ResponseMessages.Route.DoesNotExist);
            }

            var routes = BuildRoute(request.Route);
            var theCheapestDeliveryCost = CalculateTheCheapestDeliveryCost(routes, deliveryRoutes);

            return(Success(new GetTheCheapestDeliveryCostHandlerResponse(theCheapestDeliveryCost)));
        }