public async Task <AccountManagementData> HandleAsync(GetAccountManagementData message)
        {
            var transactions = await repository.GetTransactions(message.NotificationId);

            var accountManagementData = accountManagementMap.Map(transactions);

            var totalBillable = await chargeCalculator.GetValue(message.NotificationId);

            accountManagementData.TotalBillable = totalBillable;
            accountManagementData.Balance       = await transactionCalculator.TotalPaid(message.NotificationId);

            return(accountManagementData);
        }
Exemplo n.º 2
0
        public async Task <WhatToDoNextPaymentData> HandleAsync(GetWhatToDoNextPaymentDataForNotification message)
        {
            var notification = await context.GetNotificationApplication(message.Id);

            var competentAuthority = await context.UnitedKingdomCompetentAuthorities.SingleAsync(
                n => n.Id == (int)notification.CompetentAuthority);

            var result = map.Map(notification, competentAuthority);

            result.Status = await assessmentRepository.GetStatusByNotificationId(message.Id);

            result.Charge = await chargeCalculator.GetValue(message.Id);

            result.AmountPaid = await transactionCalculator.TotalPaid(message.Id);

            return(result);
        }