Example #1
0
 public SearchShopCommentsOperation(IRequestBuilder requestBuilder, IHalResponseBuilder halResponseBuilder, IShopRepository shopRepository, IShopCommentEnricher commentEnricher)
 {
     _requestBuilder     = requestBuilder;
     _halResponseBuilder = halResponseBuilder;
     _shopRepository     = shopRepository;
     _commentEnricher    = commentEnricher;
 }
Example #2
0
        public async Task Enrich(IHalResponseBuilder halResponseBuilder, OrderAggregate order)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (order == null)
            {
                throw new ArgumentNullException(nameof(order));
            }

            if (order.Status == OrderAggregateStatus.Created)
            {
                await _orderPriceCalculatorHelper.Update(order);
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetOrder(order),
                                                            (l) =>
            {
                l.AddOtherItem("shop", new Dtos.Link("/" + Constants.RouteNames.Shops + "/" + order.ShopId));
                l.AddOtherItem("user", new Dtos.Link("/" + Constants.RouteNames.Users + "/" + order.Subject));
                l.AddSelf(Constants.RouteNames.Orders + "/" + order.Id);
            }));
        }
 public SearchMessagesOperation(IMessageRepository repository, IRequestBuilder requestBuilder, IHalResponseBuilder halResponseBuilder, IMessageEnricher messageEnricher)
 {
     _repository         = repository;
     _requestBuilder     = requestBuilder;
     _halResponseBuilder = halResponseBuilder;
     _messageEnricher    = messageEnricher;
 }
Example #4
0
 public SearchMineShopsOperation(IShopRepository repository, IRequestBuilder requestBuilder, IHalResponseBuilder halResponseBuilder, IShopEnricher shopEnricher)
 {
     _repository         = repository;
     _requestBuilder     = requestBuilder;
     _halResponseBuilder = halResponseBuilder;
     _shopEnricher       = shopEnricher;
 }
 public SearchFeedItemsOperation(IRequestBuilder requestBuilder, IResponseBuilder responseBuilder, IFeedRepository feedRepository, IHalResponseBuilder halResponseBuilder)
 {
     _requestBuilder     = requestBuilder;
     _responseBuilder    = responseBuilder;
     _feedRepository     = feedRepository;
     _halResponseBuilder = halResponseBuilder;
 }
Example #6
0
 public GetMessageOperation(
     IMessageRepository messageRepository, IHalResponseBuilder halResponseBuilder, IMessageEnricher messageEnricher)
 {
     _messageRepository  = messageRepository;
     _halResponseBuilder = halResponseBuilder;
     _messageEnricher    = messageEnricher;
 }
 public SearchProductCommentsOperation(IRequestBuilder requestBuilder, IHalResponseBuilder halResponseBuilder, IProductRepository productRepository, IProductCommentEnricher commentEnricher)
 {
     _requestBuilder     = requestBuilder;
     _halResponseBuilder = halResponseBuilder;
     _productRepository  = productRepository;
     _commentEnricher    = commentEnricher;
 }
 public GetAllTagsOperation(ITagRepository repository, IHalResponseBuilder halResponseBuilder, IRequestBuilder requestBuilder, ITagEnricher tagEnricher)
 {
     _repository         = repository;
     _halResponseBuilder = halResponseBuilder;
     _requestBuilder     = requestBuilder;
     _tagEnricher        = tagEnricher;
 }
Example #9
0
 public SearchDiscountOperation(IDiscountRepository repository, IRequestBuilder requestBuilder,
                                IHalResponseBuilder halResponseBuilder, IDiscountEnricher discountEnricher)
 {
     _repository         = repository;
     _requestBuilder     = requestBuilder;
     _halResponseBuilder = halResponseBuilder;
     _discountEnricher   = discountEnricher;
 }
Example #10
0
 public SearchNotificationsOperation(IRequestBuilder requestBuilder, INotificationRepository notificationRepository,
                                     IHalResponseBuilder halResponseBuilder, INotificationEnricher notificationEnricher)
 {
     _requestBuilder         = requestBuilder;
     _notificationRepository = notificationRepository;
     _halResponseBuilder     = halResponseBuilder;
     _notificationEnricher   = notificationEnricher;
 }
Example #11
0
 public SearchOrdersOperation(IOrderRepository repository, IRequestBuilder requestBuilder,
                              IHalResponseBuilder halResponseBuilder, IOrderEnricher orderEnricher)
 {
     _repository         = repository;
     _requestBuilder     = requestBuilder;
     _halResponseBuilder = halResponseBuilder;
     _orderEnricher      = orderEnricher;
 }
 public GetNotificationStatusOperation(INotificationRepository notificationRepository, IRequestBuilder requestBuilder,
                                       IResponseBuilder responseBuilder, IHalResponseBuilder halResponseBuilder)
 {
     _notificationRepository = notificationRepository;
     _requestBuilder         = requestBuilder;
     _responseBuilder        = responseBuilder;
     _halResponseBuilder     = halResponseBuilder;
 }
 public GetProductOperation(
     IProductRepository repository, IHalResponseBuilder halResponseBuilder, IRequestBuilder requestBuilder, IProductEnricher productEnricher)
 {
     _repository         = repository;
     _halResponseBuilder = halResponseBuilder;
     _requestBuilder     = requestBuilder;
     _productEnricher    = productEnricher;
 }
 public GetOrderOperation(IOrderRepository orderRepository, IHalResponseBuilder halResponseBuilder, IOrderEnricher orderEnricher,
                          IResponseBuilder responseBuilder, IControllerHelper controllerHelper)
 {
     _orderRepository    = orderRepository;
     _halResponseBuilder = halResponseBuilder;
     _orderEnricher      = orderEnricher;
     _responseBuilder    = responseBuilder;
     _controllerHelper   = controllerHelper;
 }
Example #15
0
 public GetDiscountOperation(IDiscountRepository discountRepository, IHalResponseBuilder halResponseBuilder, IDiscountEnricher discountEnricher,
                             IResponseBuilder responseBuilder, IControllerHelper controllerHelper)
 {
     _discountRepository = discountRepository;
     _halResponseBuilder = halResponseBuilder;
     _discountEnricher   = discountEnricher;
     _responseBuilder    = responseBuilder;
     _controllerHelper   = controllerHelper;
 }
 public GetMineClientServicesOperation(
     IClientServiceRepository repository, IHalResponseBuilder halResponseBuilder,
     IRequestBuilder requestBuilder, IClientServiceEnricher enricher)
 {
     _repository         = repository;
     _halResponseBuilder = halResponseBuilder;
     _requestBuilder     = requestBuilder;
     _enricher           = enricher;
 }
 public GetServiceOperation(
     IServiceRepository repository, IHalResponseBuilder halResponseBuilder,
     IRequestBuilder requestBuilder, IServiceEnricher serviceEnricher)
 {
     _repository         = repository;
     _halResponseBuilder = halResponseBuilder;
     _requestBuilder     = requestBuilder;
     _serviceEnricher    = serviceEnricher;
 }
Example #18
0
 public GetOrderTransactionOperation(
     IOrderRepository orderRepository, IControllerHelper controllerHelper,
     IResponseBuilder responseBuilder, IHalResponseBuilder halResponseBuilder,
     IPaypalOauthClient paypalOauthClient, IPaypalClient paypalClient, ISettingsProvider settingsProvider)
 {
     _orderRepository    = orderRepository;
     _controllerHelper   = controllerHelper;
     _responseBuilder    = responseBuilder;
     _halResponseBuilder = halResponseBuilder;
     _paypalOauthClient  = paypalOauthClient;
     _paypalClient       = paypalClient;
     _settingsProvider   = settingsProvider;
 }
Example #19
0
        public void Enrich(IHalResponseBuilder halResponseBuilder, ShopCategoryAggregate category)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (category == null)
            {
                throw new ArgumentNullException(nameof(category));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetShopCategory(category), (l) => l.AddSelf(@"/" + Constants.RouteNames.ShopCategories + "/" + category.Id)));
        }
        public void Enrich(IHalResponseBuilder halResponseBuilder, DiscountAggregate discountAggregate)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (discountAggregate == null)
            {
                throw new ArgumentNullException(nameof(discountAggregate));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetDiscount(discountAggregate)));
        }
Example #21
0
        public void Enrich(IHalResponseBuilder halResponseBuilder, TagAggregate tag)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (tag == null)
            {
                throw new ArgumentNullException(nameof(tag));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetTag(tag), (l) => l.AddSelf(@"/" + Constants.RouteNames.Tags + "/" + tag.Name)));
        }
Example #22
0
        public void Enrich(IHalResponseBuilder halResponseBuilder, ServiceComment serviceComment, string serviceId)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (serviceComment == null)
            {
                throw new ArgumentNullException(nameof(serviceComment));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetServiceComment(serviceComment),
                                                            (l) => l.AddOtherItem("service", new Dtos.Link("/" + Constants.RouteNames.Services + "/" + serviceId))));
        }
        public void Enrich(IHalResponseBuilder halResponseBuilder, ProductComment productComment, string productId)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (productComment == null)
            {
                throw new ArgumentNullException(nameof(productComment));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetProductComment(productComment),
                                                            (l) => l.AddOtherItem("product", new Dtos.Link("/" + Constants.RouteNames.Products + "/" + productId))));
        }
        public void Enrich(IHalResponseBuilder halResponseBuilder, ServiceResultLine serviceResultLine)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (serviceResultLine == null)
            {
                throw new ArgumentNullException(nameof(serviceResultLine));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetServiceOccurrence(serviceResultLine),
                                                            (l) =>
            {
                l.AddOtherItem("shop", new Dtos.Link("/" + Constants.RouteNames.Shops + "/" + serviceResultLine.ShopId)).AddSelf(Constants.RouteNames.Services + "/" + serviceResultLine.Id);
            }));
        }
        public void Enrich(IHalResponseBuilder halResponseBuilder, ProductAggregate product)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (product == null)
            {
                throw new ArgumentNullException(nameof(product));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetProduct(product),
                                                            (l) =>
            {
                l.AddOtherItem("shop", new Dtos.Link("/" + Constants.RouteNames.Shops + "/" + product.ShopId)).AddSelf(Constants.RouteNames.Products + "/" + product.Id);
            }));
        }
        public void Enrich(IHalResponseBuilder halResponseBuilder, NotificationAggregate notification)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (notification == null)
            {
                throw new ArgumentNullException(nameof(notification));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetNotification(notification),
                                                            (l) =>
            {
                l.AddSelf(Constants.RouteNames.Notifications + "/" + notification.Id);
            }));
        }
        public void Enrich(IHalResponseBuilder halResponseBuilder, MessageAggregate message)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetMessage(message),
                                                            (l) =>
            {
                l.AddSelf(Constants.RouteNames.Messages + "/" + message.Id);
            }));
        }
Example #28
0
        public void Enrich(IHalResponseBuilder halResponseBuilder, ShopAggregate shop)
        {
            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetShop(shop),
                                                            (l) =>
            {
                l.AddOtherItem("category", new Dtos.Link("/" + Constants.RouteNames.ShopCategories + "/" + shop.CategoryId, shop.ShopCategory.Name)).AddSelf(Constants.RouteNames.Shops + "/" + shop.Id);
                if (shop.ShopFilters != null && shop.ShopFilters.Any())
                {
                    foreach (var filter in shop.ShopFilters)
                    {
                        l.AddOtherItem("filters", new Dtos.Link("/" + Constants.RouteNames.Filers + "/" + filter.Id, filter.Name));
                    }
                }

                if (shop.ProductCategories != null && shop.ProductCategories.Any())
                {
                    foreach (var productCategory in shop.ProductCategories)
                    {
                        l.AddOtherItem("productCategories", new Dtos.Link("/" + Constants.RouteNames.Filers + "/" + productCategory.Id, productCategory.Name));
                    }
                }
            }));
        }
        public void Enrich(IHalResponseBuilder halResponseBuilder, ClientServiceAggregate announcement)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (announcement == null)
            {
                throw new ArgumentNullException(nameof(announcement));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetClientService(announcement),
                                                            (l) =>
            {
                if (announcement.Category == null)
                {
                    return;
                }

                l.AddOtherItem("category", new Dtos.Link("/" + Constants.RouteNames.ShopCategories + "/" + announcement.CategoryId)).AddSelf(Constants.RouteNames.ClientServices + "/" + announcement.Id);
            }));
        }
 public GetShopOperation(IShopRepository repository, IHalResponseBuilder halResponseBuilder, IShopEnricher shopEnricher)
 {
     _repository         = repository;
     _halResponseBuilder = halResponseBuilder;
     _shopEnricher       = shopEnricher;
 }