예제 #1
0
 public GetImportKeyDatesOverrideDataHandler(IKeyDatesOverrideRepository repository,
                                             IImportNotificationAssessmentRepository assessmentRepository,
                                             DecisionRequiredBy decisionRequiredBy)
 {
     this.repository           = repository;
     this.assessmentRepository = assessmentRepository;
     this.decisionRequiredBy   = decisionRequiredBy;
 }
예제 #2
0
 public SetExportKeyDatesOverrideHandler(IKeyDatesOverrideRepository repository,
                                         INotificationAssessmentRepository assessmentRepository,
                                         INotificationApplicationRepository applicationRepository,
                                         DecisionRequiredBy decisionRequiredBy)
 {
     this.repository            = repository;
     this.assessmentRepository  = assessmentRepository;
     this.applicationRepository = applicationRepository;
     this.decisionRequiredBy    = decisionRequiredBy;
 }
예제 #3
0
 public NotificationAssessmentDatesSummaryRepository(DecisionRequiredBy decisionRequiredBy,
                                                     INotificationAssessmentRepository notificationAssessmentRepository,
                                                     INotificationApplicationRepository notificationApplicationRepository,
                                                     INotificationTransactionCalculator transactionCalculator,
                                                     INotificationApplicationAuthorization authorization)
 {
     this.decisionRequiredBy = decisionRequiredBy;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.notificationAssessmentRepository  = notificationAssessmentRepository;
     this.transactionCalculator             = transactionCalculator;
     this.authorization = authorization;
 }
 public NotificationAssessmentDatesSummaryRepository(DecisionRequiredBy decisionRequiredBy,
     INotificationAssessmentRepository notificationAssessmentRepository,
     INotificationApplicationRepository notificationApplicationRepository,
     INotificationTransactionCalculator transactionCalculator,
     INotificationApplicationAuthorization authorization)
 {
     this.decisionRequiredBy = decisionRequiredBy;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.notificationAssessmentRepository = notificationAssessmentRepository;
     this.transactionCalculator = transactionCalculator;
     this.authorization = authorization;
 }
예제 #5
0
        public async Task GetNotificationDatesSummaryByIdChecksAuthorization()
        {
            var notification = NotificationApplicationFactory.Create(userId, NotificationType.Recovery,
                                                                     UKCompetentAuthority.England, 20181);

            context.NotificationApplications.Add(notification);
            context.SaveChanges();

            var notificationId = notification.Id;

            var decisionRequiredBy = new DecisionRequiredBy(A.Fake <IDecisionRequiredByCalculator>(),
                                                            A.Fake <IFacilityRepository>());
            var assessmentRepository  = A.Fake <INotificationAssessmentRepository>();
            var applicationRepository = A.Fake <INotificationApplicationRepository>();
            var transactionCalculator = A.Fake <INotificationTransactionCalculator>();
            var assessment            = new NotificationAssessment(notificationId);

            ObjectInstantiator <NotificationAssessment> .SetProperty(x => x.Status, NotificationStatus.NotificationReceived, assessment);

            A.CallTo(() => assessmentRepository.GetByNotificationId(notificationId))
            .Returns(assessment);
            A.CallTo(() => applicationRepository.GetById(notificationId)).Returns(notification);

            var transaction = new NotificationTransaction(
                new NotificationTransactionData
            {
                Credit         = 1,
                Date           = new DateTime(2017, 1, 1),
                NotificationId = notificationId,
                PaymentMethod  = PaymentMethod.Card
            });

            A.CallTo(() => transactionCalculator.PaymentReceivedDate(notificationId))
            .Returns(transaction);
            A.CallTo(() => transactionCalculator.LatestPayment(notificationId))
            .Returns(transaction);
            A.CallTo(() => transactionCalculator.IsPaymentComplete(notificationId)).Returns(true);

            var repository = new NotificationAssessmentDatesSummaryRepository(decisionRequiredBy,
                                                                              assessmentRepository,
                                                                              applicationRepository,
                                                                              transactionCalculator,
                                                                              notificationApplicationAuthorization);

            await repository.GetById(notificationId);

            A.CallTo(() => notificationApplicationAuthorization.EnsureAccessAsync(notificationId)).MustHaveHappened();

            context.DeleteOnCommit(notification);
            await context.SaveChangesAsync();
        }
 public GetNotificationAttentionSummaryHandler(INotificationAttentionSummaryRepository attentionSummaryRepository,
                                               IUserContext userContext,
                                               IInternalUserRepository internalUserRepository,
                                               DecisionRequiredBy decisionRequiredByCalculator,
                                               INotificationAssessmentRepository notificationAssessmentRepository,
                                               INotificationApplicationRepository notificationApplicationRepository,
                                               DaysRemainingCalculator daysRemainingCalculator)
 {
     this.attentionSummaryRepository = attentionSummaryRepository;
     this.userContext                       = userContext;
     this.internalUserRepository            = internalUserRepository;
     this.decisionRequiredByCalculator      = decisionRequiredByCalculator;
     this.notificationAssessmentRepository  = notificationAssessmentRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.daysRemainingCalculator           = daysRemainingCalculator;
 }
예제 #7
0
 public GetKeyDatesHandler(IImportNotificationAssessmentRepository notificationAssessmentRepository,
                           IInterimStatusRepository interimStatusRepository,
                           DecisionRequiredBy decisionRequiredBy,
                           IImportNotificationTransactionCalculator transactionCalculator,
                           IImportNotificationAssessmentDecisionRepository notificationAssessmentDecisionRepository,
                           IImportNotificationRepository notificationRepository,
                           IConsultationRepository consultationRepository)
 {
     this.notificationAssessmentRepository = notificationAssessmentRepository;
     this.interimStatusRepository          = interimStatusRepository;
     this.decisionRequiredBy    = decisionRequiredBy;
     this.transactionCalculator = transactionCalculator;
     this.notificationAssessmentDecisionRepository = notificationAssessmentDecisionRepository;
     this.notificationRepository = notificationRepository;
     this.consultationRepository = consultationRepository;
 }
예제 #8
0
        public DecisionRequiredByTests()
        {
            notificationId     = new Guid();
            competentAuthority = UKCompetentAuthority.England;

            decisionRequiredByCalculator = A.Fake <IDecisionRequiredByCalculator>();
            facilityRepository           = A.Fake <IFacilityRepository>();
            importNotificationRepository = A.Fake <IImportNotificationRepository>();
            assessment = new ImportNotificationAssessment(notificationId);

            decisionRequiredBy = new DecisionRequiredBy(importNotificationRepository, facilityRepository, decisionRequiredByCalculator);

            decisionRequiredByDateWhenPopulatedInDB    = new DateTime(2019, 1, 1);
            decisionRequiredByDateWhenNotPopulatedInDB = null;
            acknowledgedDateWhenHasValue   = new DateTime(2019, 2, 2);
            acknowledgedDateWhenHasNoValue = null;
            decisionRequiredByDateWhenAcknowledgeDateHasNoValue = null;
            decisionRequiredByDateWhenCalculated = new DateTime(2019, 3, 3);
        }
예제 #9
0
        public DecisionRequiredByTests()
        {
            var applicationId      = new Guid();
            var userId             = new Guid();
            var notificationType   = NotificationType.Recovery;
            var competentAuthority = UKCompetentAuthority.England;
            var notificationNumber = 1;

            decisionRequiredByCalculator = A.Fake <IDecisionRequiredByCalculator>();
            facilityRepository           = A.Fake <IFacilityRepository>();
            assessment  = new NotificationAssessment(applicationId);
            application = new NotificationApplication(userId, notificationType, competentAuthority, notificationNumber);

            decisionRequiredBy = new DecisionRequiredBy(decisionRequiredByCalculator, facilityRepository);

            decisionRequiredByDateWhenPopulatedInDB    = new DateTime(2019, 1, 1);
            decisionRequiredByDateWhenNotPopulatedInDB = null;
            acknowledgedDateWhenHasValue   = new DateTime(2019, 2, 2);
            acknowledgedDateWhenHasNoValue = null;
            decisionRequiredByDateWhenAcknowledgeDateHasNoValue = null;
            decisionRequiredByDateWhenCalculated = new DateTime(2019, 3, 3);
        }