Esempio n. 1
0
 public VideoHearing(CaseType caseType, HearingType hearingType, DateTime scheduledDateTime, int scheduledDuration,
                     HearingVenue hearingVenue, string hearingRoomName, string otherInformation, string createdBy,
                     bool questionnaireNotRequired, bool audioRecordingRequired, string cancelReason) :
     base(caseType, hearingType, scheduledDateTime, scheduledDuration, hearingVenue, hearingRoomName,
          otherInformation, createdBy, questionnaireNotRequired, audioRecordingRequired, cancelReason)
 {
 }
Esempio n. 2
0
        public void UpdateHearingDetails(HearingVenue hearingVenue, DateTime scheduledDateTime,
                                         int scheduledDuration, string hearingRoomName, string otherInformation, string updatedBy,
                                         List <Case> cases, bool questionnaireNotRequired, bool audioRecordingRequired)
        {
            ValidateScheduledDate(scheduledDateTime);

            if (scheduledDuration <= 0)
            {
                _validationFailures.AddFailure("ScheduledDuration", "ScheduledDuration is not a valid value");
            }

            if (hearingVenue == null || hearingVenue.Id <= 0)
            {
                _validationFailures.AddFailure("Venue", "Venue must have a valid value");
            }

            if (_validationFailures.Any())
            {
                throw new DomainRuleException(_validationFailures);
            }

            if (hearingVenue != null)
            {
                HearingVenue     = hearingVenue;
                HearingVenueName = hearingVenue.Name;
            }

            if (cases.Any())
            {
                UpdateCase(cases.First());
            }

            ScheduledDateTime = scheduledDateTime;
            ScheduledDuration = scheduledDuration;

            HearingRoomName          = hearingRoomName;
            OtherInformation         = otherInformation;
            UpdatedBy                = updatedBy;
            UpdatedDate              = DateTime.UtcNow;
            QuestionnaireNotRequired = questionnaireNotRequired;
            AudioRecordingRequired   = audioRecordingRequired;
        }
Esempio n. 3
0
        protected Hearing(CaseType caseType, HearingType hearingType, DateTime scheduledDateTime,
                          int scheduledDuration, HearingVenue hearingVenue, string hearingRoomName,
                          string otherInformation, string createdBy, bool questionnaireNotRequired,
                          bool audioRecordingRequired, string cancelReason)
            : this()
        {
            ValidateArguments(scheduledDateTime, scheduledDuration, hearingVenue, hearingType);

            ScheduledDateTime = scheduledDateTime;
            ScheduledDuration = scheduledDuration;
            CaseTypeId        = caseType.Id;
            HearingTypeId     = hearingType.Id;
            HearingVenueName  = hearingVenue.Name;

            Status                   = BookingStatus.Booked;
            HearingRoomName          = hearingRoomName;
            OtherInformation         = otherInformation;
            CreatedBy                = createdBy;
            QuestionnaireNotRequired = questionnaireNotRequired;
            AudioRecordingRequired   = audioRecordingRequired;
            CancelReason             = cancelReason;
        }
Esempio n. 4
0
        private void ValidateArguments(DateTime scheduledDateTime, int scheduledDuration, HearingVenue hearingVenue,
                                       HearingType hearingType)
        {
            ValidateScheduledDate(scheduledDateTime);

            if (scheduledDuration <= 0)
            {
                _validationFailures.AddFailure("ScheduledDuration", "ScheduledDuration is not a valid value");
            }

            if (hearingVenue == null || hearingVenue.Id <= 0)
            {
                _validationFailures.AddFailure("HearingVenue", "HearingVenue must have a valid value");
            }
            if (hearingType == null || hearingType.Id <= 0)
            {
                _validationFailures.AddFailure("HearingType", "HearingType must have a valid value");
            }

            if (_validationFailures.Any())
            {
                throw new DomainRuleException(_validationFailures);
            }
        }