Beispiel #1
0
        public async Task <WarrantyDecisionDto> Handle(WarrantyRequest request, CancellationToken cancellationToken)
        {
            var order = await _ordersRepository.GetById(request.OrderItemUid);

            var item = await _itemsRepository.GetById(order.ItemId);

            if (order != null && item != null)
            {
                var isInStock = item.AvailableCount != 0;
                var result    = await _warrantyService.GetWarrantyDecision(order.OrderItemUid, isInStock);

                return(new WarrantyDecisionDto {
                    Decision = result.Decision
                });
            }
            return(null);
        }