public async Task<ActionResult> AddRefund(RefundDetailsViewModel model)
        {
            if (!ModelState.IsValid)
            {
                var data = await mediator.SendAsync(new GetImportNotificationAccountOverview(model.NotificationId));
                var accountManagementViewModel = new AccountManagementViewModel(data);
                accountManagementViewModel.PaymentViewModel = new PaymentDetailsViewModel();
                accountManagementViewModel.RefundViewModel = model;
                accountManagementViewModel.ShowRefundDetails = true;

                return View("Index", accountManagementViewModel);
            }

            var refundData = new AddNotificationRefund(model.NotificationId, Convert.ToDecimal(model.RefundAmount),
                model.RefundDate.AsDateTime().Value, model.RefundComments);

            await mediator.SendAsync(refundData);

            return RedirectToAction("index", "AccountManagement", new { id = model.NotificationId });
        }
        public async Task <ActionResult> AddRefund(RefundDetailsViewModel model)
        {
            if (!ModelState.IsValid)
            {
                var data = await mediator.SendAsync(new GetImportNotificationAccountOverview(model.NotificationId));

                var accountManagementViewModel = new AccountManagementViewModel(data);
                accountManagementViewModel.PaymentViewModel  = new PaymentDetailsViewModel();
                accountManagementViewModel.RefundViewModel   = model;
                accountManagementViewModel.ShowRefundDetails = true;

                return(View("Index", accountManagementViewModel));
            }

            var refundData = new AddNotificationRefund(model.NotificationId, Convert.ToDecimal(model.RefundAmount),
                                                       model.RefundDate.AsDateTime().Value, model.RefundComments.Trim());

            await mediator.SendAsync(refundData);

            return(RedirectToAction("index", "AccountManagement", new { id = model.NotificationId }));
        }