Exemple #1
0
        public async Task <IActionResult> DebtSold([FromRoute] Guid id)
        {
            var creditor = await _integrationGateway.GetGenericCreditorByIdAsync(id.ToString());

            var debt = GetTempDataObject <CreditorDebtPartialViewModel>(_selectedDebt);


            var isAdHocCreditor = HttpContext.Session.TryGetValue(_newCreditorId, out _);

            var model = new CreditorDebtSoldViewModel
            {
                Creditor        = creditor,
                Debt            = debt,
                IsAdHocCreditor = isAdHocCreditor
            };

            var storedModel = GetJourneyObject <CreditorDebtSoldViewModel>(nameof(DebtSold));

            if (storedModel != null)
            {
                model = storedModel;
                TryValidateModel(model);
            }

            return(View(model));
        }
Exemple #2
0
        public async Task <IActionResult> DebtSold(CreditorDebtSoldViewModel model)
        {
            SetJourneyObject(model);

            await _creditorServiceGateway.SubmitDebtSold(model);

            var modelOut = new CreditorBannerViewModel
            {
                BannerHeading = _bannerHeader,
                BannerText    = "We’ve told Advice UK you’ve sold the debt",
            };

            TempData.Remove(_addressSearchModel);
            HttpContext.Session.Remove(_newCreditorId);
            return(CompleteSubJourneyRedirect(nameof(BreathingSpace), modelOut));
        }