Example #1
0
 private Details.PastTrainingParticipant BuildPastParticipant(EnrollmentReadModel readModel, Training subject)
 {
     return(new Details.PastTrainingParticipant()
     {
         Id = readModel.Id.GetGuid(),
         FullName = readModel.FullName,
         Email = readModel.Email,
         Phone = readModel.PhoneNumber,
         HasLecturerRights = readModel.HasLecturerRights,
         IsUnreported = readModel.TrainingResult == null,
         IsInvited = readModel.SelectedTraining != null,
         CanRecordTrainingResults = readModel.CanReportTrainingResults &&
                                    readModel.TrainingResult == null &&
                                    readModel.SelectedTraining != null &&
                                    readModel.SelectedTraining.ID == subject.ID,
         CanRecordTrainingResultsConditionally = readModel.CanReportTrainingResultsConditionally &&
                                                 (readModel.SelectedTraining == null || readModel.SelectedTraining.ID != subject.ID) &&
                                                 readModel.TrainingResult == null,
         HasResignedPermanently = readModel.HasResignedPermanently,
         HasResignedTemporarily = readModel.HasResignedTemporarilyAsOf(subject.StartDateTime.ToInstant()),
         ResignationEndDate = readModel.HasResignedTemporarilyAsOf(subject.StartDateTime.ToInstant()) ? readModel.ResumeDate : null,
         ChoseAnotherTraining = readModel.SelectedTraining != null && readModel.SelectedTraining.ID != subject.ID,
         WasAbsent = readModel.TrainingResult == Recruitment.Enrollments.RecordTrainingResults.TrainingResult.Absent,
         WasPresentAndAcceptedAsLecturer = readModel.TrainingResult == Recruitment.Enrollments.RecordTrainingResults.TrainingResult.PresentAndAcceptedAsLecturer,
         WasPresentButDidNotAcceptedAsLecturer = readModel.TrainingResult == Recruitment.Enrollments.RecordTrainingResults.TrainingResult.PresentButNotAcceptedAsLecturer,
     });
 }
Example #2
0
 private Details.CurrentTrainingParticipant BuildCurrentTrainingParticipant(EnrollmentReadModel readModel, Training subject)
 {
     return(new Details.CurrentTrainingParticipant()
     {
         Id = readModel.Id.GetGuid(),
         FullName = readModel.FullName,
         Email = readModel.Email,
         Phone = readModel.PhoneNumber,
         HasLecturerRights = readModel.HasLecturerRights,
         ChoseAnotherTraining = readModel.SelectedTraining?.ID != subject.ID,
         HasResignedPermanently = readModel.HasResignedPermanently,
         HasResignedTemporarily = readModel.HasResignedTemporarilyAsOf(_clock.GetCurrentInstant()),
         ResignationEndDate = readModel.HasResignedTemporarilyAsOf(_clock.GetCurrentInstant()) ? readModel.ResumeDate : null
     });
 }
Example #3
0
 private Details.FutureTrainingParticipant BuildFutureParticipant(EnrollmentReadModel readModel, Training subject)
 {
     return(new Details.FutureTrainingParticipant()
     {
         Id = readModel.Id.GetGuid(), FullName = readModel.FullName,
         Email = readModel.Email, Phone = readModel.PhoneNumber,
         HasAccepted = readModel.SelectedTraining != null,
         HasLecturerRights = readModel.HasLecturerRights,
         HasResignedPermanently = readModel.HasResignedPermanently,
         HasResignedTemporarily = readModel.HasResignedTemporarilyAsOf(_clock.GetCurrentInstant()),
         ResignationEndDate = readModel.HasResignedTemporarilyAsOf(_clock.GetCurrentInstant()) ? readModel.ResumeDate : null,
         CanBeInvited = readModel.SelectedTraining == null && readModel.HasResignedPermanently == false && readModel.HasResignedTemporarilyAsOf(_clock.GetCurrentInstant()) == false,
         ChoseAnotherTraining = readModel.SelectedTraining != null && readModel.SelectedTraining.ID != subject.ID
     });
 }