Esempio n. 1
0
        public async Task <NotificationDatesSummary> GetById(Guid notificationId)
        {
            await authorization.EnsureAccessAsync(notificationId);

            var assessment = await notificationAssessmentRepository.GetByNotificationId(notificationId);

            var notification = await notificationApplicationRepository.GetById(notificationId);

            var paymentReceived = await transactionCalculator.PaymentReceivedDate(notificationId) ??
                                  await transactionCalculator.LatestPayment(notificationId);

            DateTime?paymentReceivedDate = null;

            if (paymentReceived != null)
            {
                paymentReceivedDate = paymentReceived.Date;
            }

            return(NotificationDatesSummary.Load(
                       assessment.Status,
                       assessment.Dates.NotificationReceivedDate,
                       notificationId,
                       paymentReceivedDate,
                       await transactionCalculator.IsPaymentComplete(notificationId),
                       assessment.Dates.CommencementDate,
                       assessment.Dates.NameOfOfficer,
                       assessment.Dates.CompleteDate,
                       assessment.Dates.TransmittedDate,
                       assessment.Dates.AcknowledgedDate,
                       await decisionRequiredBy.GetDecisionRequiredByDate(notification, assessment),
                       assessment.Dates.FileClosedDate,
                       assessment.Dates.ArchiveReference));
        }
Esempio n. 2
0
 private async Task <bool> IsPaymentComplete(Guid notificationId)
 {
     return(await notificationTransactionCalculator.IsPaymentComplete(notificationId));
 }
 private void SetPaymentComplete(bool isComplete)
 {
     A.CallTo(() => notificationTransactionCalculator.IsPaymentComplete(notificationId))
     .Returns(isComplete);
 }