public async Task <ActionResult> Refuse(Guid id, RefuseFinancialGuaranteeViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            await mediator.SendAsync(new RefuseFinancialGuarantee(id, model.FinancialGuaranteeId,
                                                                  model.DecisionMadeDate.AsDateTime().Value, model.ReasonForRefusal));

            return(RedirectToAction("Index", "FinancialGuaranteeAssessment"));
        }
        public async Task <ActionResult> Refuse(Guid id, Guid financialGuaranteeId)
        {
            var financialGuarantee = await mediator.SendAsync(
                new GetFinancialGuaranteeDataByNotificationApplicationId(id, financialGuaranteeId));

            if (financialGuarantee.Status != FinancialGuaranteeStatus.ApplicationComplete)
            {
                return(RedirectToAction("Index", "FinancialGuaranteeAssessment"));
            }

            var model = new RefuseFinancialGuaranteeViewModel(financialGuarantee)
            {
                NotificationId       = id,
                FinancialGuaranteeId = financialGuaranteeId
            };

            return(View(model));
        }
        public async Task<ActionResult> Refuse(Guid id, Guid financialGuaranteeId)
        {
            var financialGuarantee = await mediator.SendAsync(
                new GetFinancialGuaranteeDataByNotificationApplicationId(id, financialGuaranteeId));

            if (financialGuarantee.Status != FinancialGuaranteeStatus.ApplicationComplete)
            {
                return RedirectToAction("Index", "FinancialGuaranteeAssessment");
            }

            var model = new RefuseFinancialGuaranteeViewModel(financialGuarantee)
            {
                NotificationId = id,
                FinancialGuaranteeId = financialGuaranteeId
            };

            return View(model);
        }
        public async Task<ActionResult> Refuse(Guid id, RefuseFinancialGuaranteeViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            await mediator.SendAsync(new RefuseFinancialGuarantee(id, model.FinancialGuaranteeId,
                model.DecisionMadeDate.AsDateTime().Value, model.ReasonForRefusal));

            return RedirectToAction("Index", "FinancialGuaranteeAssessment");
        }