Пример #1
0
        public async Task <IActionResult> Complete(Guid id, AmendDirectDebitConfirmVm amendDirectDebitCompleteVm)
        {
            // Take from cached form state
            var amendDirectDebitVm = DeserialiseModel <AmendDirectDebitVm>(amendDirectDebitCompleteVm.FilledInState);

            // Perform final validation and amend
            var result = await _amendDirectDebitPlanService.AmendDirectDebitPlan(
                LoggedInUser, ApplicationSessionState, id, amendDirectDebitVm, GetCaseflowUserId());

            if (!result)
            {
                await LogAmendDirectDebitCompleteFailure(amendDirectDebitVm);

                return(View("ValidationFailed"));
            }

            await LogAmendDirectDebitCompleteSuccess(amendDirectDebitVm);

            _gtmService.RaiseAmendDirectDebitEvent_Confirmed(amendDirectDebitVm, LoggedInUserId);
            ApplicationSessionState.LogSetUpPlanResult = false;


            return(View(amendDirectDebitVm));
        }