public void Should_map_judge()
        {
            var caseRole    = new CaseRole(5, "Judge");
            var hearingRole = new HearingRole(13, "Judge")
            {
                UserRole = new UserRole(4, "Judge")
            };

            var person = new PersonBuilder().Build();
            var judge  = new Judge(person, hearingRole, caseRole)
            {
                DisplayName = "Judge",
                CreatedBy   = "*****@*****.**"
            };

            judge.SetProtected(nameof(judge.CaseRole), caseRole);
            judge.SetProtected(nameof(judge.HearingRole), hearingRole);

            var response = _mapper.MapParticipantToResponse(judge);

            AssertParticipantCommonDetails(response, judge, caseRole, hearingRole);
            AssertRepresentativeResponse(response, null);
            AssertAddressMapping(response, null);
            response.Organisation.Should().BeNullOrWhiteSpace();
        }
Beispiel #2
0
 protected Participant(Person person, HearingRole hearingRole, CaseRole caseRole) : this()
 {
     Person        = person;
     PersonId      = person.Id;
     HearingRoleId = hearingRole.Id;
     CaseRoleId    = caseRole.Id;
 }
Beispiel #3
0
        public void Should_Map_Individual_With_Linked_Participants()
        {
            var caseRole    = new CaseRole(1, "Applicant");
            var hearingRole = new HearingRole(1, "Litigant in person")
            {
                UserRole = new UserRole(5, "Individual")
            };

            var person   = new PersonBuilder().Build();
            var linkedId = Guid.NewGuid();
            var link     = new List <LinkedParticipant>
            {
                new LinkedParticipant(Guid.NewGuid(), linkedId, LinkedParticipantType.Interpreter)
            };

            var individual = new Individual(person, hearingRole, caseRole)
            {
                DisplayName        = "Individual guy",
                CreatedBy          = "*****@*****.**",
                LinkedParticipants = link
            };

            individual.SetProtected(nameof(individual.CaseRole), caseRole);
            individual.SetProtected(nameof(individual.HearingRole), hearingRole);

            var response = _mapper.MapParticipantToResponse(individual);

            AssertParticipantCommonDetails(response, individual, caseRole, hearingRole);
            AssertRepresentativeResponse(response, null);
            response.LinkedParticipants.Should().NotContainNulls();
            response.LinkedParticipants.Select(x => x.LinkedId).Should().BeEquivalentTo(linkedId);
        }
        public void Should_map_individual()
        {
            var caseRole    = new CaseRole(1, "Claimant");
            var hearingRole = new HearingRole(1, "Claimant LIP")
            {
                UserRole = new UserRole(5, "Individual")
            };

            var person     = new PersonBuilder().WithAddress().WithOrganisation().Build();
            var individual = new Individual(person, hearingRole, caseRole)
            {
                DisplayName = "I. Vidual",
                CreatedBy   = "*****@*****.**"
            };

            individual.SetProtected(nameof(individual.CaseRole), caseRole);
            individual.SetProtected(nameof(individual.HearingRole), hearingRole);

            var response = _mapper.MapParticipantToResponse(individual);

            AssertParticipantCommonDetails(response, individual, caseRole, hearingRole);
            AssertRepresentativeResponse(response, null);
            AssertAddressMapping(response, person);
            response.Organisation.Should().Be(person.Organisation.Name);
        }
        public void Should_map_representative()
        {
            var caseRole    = new CaseRole(1, "Claimant");
            var hearingRole = new HearingRole(2, "Representative")
            {
                UserRole = new UserRole(6, "Representative")
            };

            var person         = new PersonBuilder().WithOrganisation().Build();
            var representative = new Representative(person, hearingRole, caseRole)
            {
                Reference   = "HUHIUHFIH",
                Representee = "Mr A. Daijif",
                DisplayName = "I. Vidual",
                CreatedBy   = "*****@*****.**"
            };

            representative.SetProtected(nameof(representative.CaseRole), caseRole);
            representative.SetProtected(nameof(representative.HearingRole), hearingRole);

            var response = _mapper.MapParticipantToResponse(representative);

            AssertParticipantCommonDetails(response, representative, caseRole, hearingRole);
            AssertRepresentativeResponse(response, representative);
            AssertAddressMapping(response, null);
            response.Organisation.Should().Be(person.Organisation.Name);
        }
Beispiel #6
0
        public void Should_map_staffMember()
        {
            const string staffMemberName   = "Staff Member";
            var          caseRole          = new CaseRole(222, staffMemberName);
            var          staffMemberUserId = UserRoleForHearingRole.UserRoleId["Staff Member"];

            var hearingRole = new HearingRole(727, staffMemberName)
            {
                UserRole = new UserRole(staffMemberUserId, staffMemberName)
            };

            var person      = new PersonBuilder().Build();
            var staffMember = new StaffMember(person, hearingRole, caseRole)
            {
                DisplayName = "Staff Member",
                CreatedBy   = "*****@*****.**"
            };

            staffMember.SetProtected(nameof(staffMember.CaseRole), caseRole);
            staffMember.SetProtected(nameof(staffMember.HearingRole), hearingRole);

            var response = _mapper.MapParticipantToResponse(staffMember);

            AssertParticipantCommonDetails(response, staffMember, caseRole, hearingRole);
            AssertRepresentativeResponse(response, null);
            response.Organisation.Should().BeNullOrWhiteSpace();
        }
        public void Should_map_all_properties()
        {
            var refDataBuilder = new RefDataBuilder();
            var venue          = refDataBuilder.HearingVenues.First(x => x.Name == _hearingVenueName);
            var caseType       = new CaseType(1, _caseTypeName);
            var hearingType    = Builder <HearingType> .CreateNew().WithFactory(() => new HearingType(_hearingTypeName)).Build();

            var        scheduledDateTime        = DateTime.Today.AddDays(1).AddHours(11).AddMinutes(45);
            var        duration                 = 80;
            var        hearingRoomName          = "Roome03";
            var        otherInformation         = "OtherInformation03";
            var        createdBy                = "User03";
            const bool questionnaireNotRequired = false;
            const bool audioRecordingRequired   = true;
            var        cancelReason             = "Online abandonment (incomplete registration)";

            var hearing = new VideoHearing(caseType, hearingType, scheduledDateTime, duration, venue, hearingRoomName,
                                           otherInformation, createdBy, questionnaireNotRequired, audioRecordingRequired, cancelReason);

            _videoHearing = Builder <VideoHearing> .CreateNew().WithFactory(() =>
                                                                            hearing).Build();

            var applicantCaseRole       = new CaseRole(1, "Applicant");
            var applicantLipHearingRole = new HearingRole(1, "Litigant in person")
            {
                UserRole = new UserRole(1, "Individual")
            };

            _videoHearing.AddCase("0875", "Test Case Add", false);

            var person1 = new PersonBuilder(true).Build();

            _videoHearing.AddIndividual(person1, applicantLipHearingRole, applicantCaseRole,
                                        $"{person1.FirstName} {person1.LastName}");

            var party = _videoHearing.GetParticipants().FirstOrDefault();

            party.SetProtected(nameof(party.CaseRole), applicantCaseRole);
            party.SetProtected(nameof(party.HearingRole), applicantLipHearingRole);

            var endpoints = new Endpoint("displayName", "333", "200", null);

            _videoHearing.AddEndpoint(endpoints);

            // Set the navigation properties as well since these would've been set if we got the hearing from DB
            _videoHearing.SetProtected(nameof(_videoHearing.HearingType), hearingType);
            _videoHearing.SetProtected(nameof(_videoHearing.CaseType), caseType);
            _videoHearing.SetProtected(nameof(_videoHearing.HearingVenue), venue);

            var response = _mapper.MapHearingToDetailedResponse(_videoHearing);

            response.Should().BeEquivalentTo(response, options => options
                                             .Excluding(v => v.Id)
                                             );
        }
Beispiel #8
0
        public void Should_raise_exception_if_adding_judge_twice()
        {
            var hearingBuilder = new VideoHearingBuilder();
            var hearing        = hearingBuilder.Build();
            var existingJudge  = hearingBuilder.Judge;

            var judgeCaseRole    = new CaseRole(5, "Judge");
            var judgeHearingRole = new HearingRole(13, "Judge");
            var newPerson        = new PersonBuilder(existingJudge.Username).Build();

            When(() => hearing.AddJudge(newPerson, judgeHearingRole, judgeCaseRole, "Judge Dredd"))
            .Should().Throw <DomainRuleException>().WithMessage("Judge with given username already exists in the hearing");
        }
        public void Should_raise_exception_if_adding_judicial_office_holder_twice()
        {
            var hearingBuilder = new VideoHearingBuilder();
            var hearing        = hearingBuilder.Build();
            var existingJoh    = hearingBuilder.JudicialOfficeHolder;

            var johCaseRole    = new CaseRole(7, "Judicial Office Holder");
            var johHearingRole = new HearingRole(14, "Judicial Office Holder");
            var newPerson      = new PersonBuilder(existingJoh.Username).Build();

            When(() => hearing.AddJudicialOfficeHolder(newPerson, johHearingRole, johCaseRole, "Joh"))
            .Should().Throw <DomainRuleException>().WithMessage("Judicial office holder already exists in the hearing");
        }
Beispiel #10
0
        public void Should_add_judge_to_hearing()
        {
            var hearing          = new VideoHearingBuilder().Build();
            var judgeCaseRole    = new CaseRole(5, "Judge");
            var judgeHearingRole = new HearingRole(13, "Judge");

            var newPerson      = new PersonBuilder(true).Build();
            var beforeAddCount = hearing.GetParticipants().Count;

            hearing.AddJudge(newPerson, judgeHearingRole, judgeCaseRole, "Judge Display Name");
            var afterAddCount = hearing.GetParticipants().Count;

            afterAddCount.Should().BeGreaterThan(beforeAddCount);
        }
        public void Should_add_judicial_office_holder_to_hearing()
        {
            var hearing        = new VideoHearingBuilder().Build();
            var johCaseRole    = new CaseRole(7, "Judicial Office Holder");
            var johHearingRole = new HearingRole(14, "Judicial Office Holder");

            var newPerson      = new PersonBuilder(true).Build();
            var beforeAddCount = hearing.GetParticipants().Count;

            hearing.AddJudicialOfficeHolder(newPerson, johHearingRole, johCaseRole, "Joh Display Name");
            var afterAddCount = hearing.GetParticipants().Count;

            afterAddCount.Should().BeGreaterThan(beforeAddCount);
        }
Beispiel #12
0
        public async Task Should_return_mapped_participants()
        {
            const string email = "*****@*****.**";

            var caseRole    = new CaseRole(1, "");
            var hearingRole = new HearingRole(1, "");

            var participants = new List <Participant>
            {
                new Individual
                (
                    new Person("mr", "test", "er", "*****@*****.**"),
                    hearingRole,
                    caseRole
                ),
                new Individual
                (
                    new Person("mr", "test", "er", "*****@*****.**"),
                    hearingRole,
                    caseRole
                )
            };

            participants[0].Person.Organisation   = new Organisation("");
            participants[0].CaseRole              = caseRole;
            participants[0].CaseRole.HearingRoles = new List <HearingRole>();
            participants[0].HearingRole           = hearingRole;
            participants[0].HearingRole.UserRole  = new UserRole(1, "");

            participants[1].Person.Organisation   = new Organisation("");
            participants[1].CaseRole              = caseRole;
            participants[1].CaseRole.HearingRoles = new List <HearingRole>();
            participants[1].HearingRole           = hearingRole;
            participants[1].HearingRole.UserRole  = new UserRole(1, "");


            _queryHandlerMock
            .Setup(x => x.Handle <GetParticipantsByUsernameQuery, List <Participant> >(It.IsAny <GetParticipantsByUsernameQuery>()))
            .ReturnsAsync(participants);

            var result = await _controller.GetParticipantsByUsername(email);

            result.Should().NotBeNull();
            var objectResult = result as OkObjectResult;
            var data         = (IEnumerable <ParticipantResponse>)objectResult.Value;

            data.Count().Should().Be(2);
            objectResult.StatusCode.Should().Be((int)HttpStatusCode.OK);
        }
Beispiel #13
0
        public ParticipantBuilder()
        {
            var claimantCaseRole       = new CaseRole(1, "Claimant");
            var defendantCaseRole      = new CaseRole(2, "Defendant");
            var claimantLipHearingRole = new HearingRole(1, "Claimant LIP");

            claimantLipHearingRole.UserRole = new UserRole(5, "Individual");
            var defendantRepresentativeHearingRole = new HearingRole(5, "Representative");

            defendantRepresentativeHearingRole.UserRole = new UserRole(6, "Representative");
            var defendantLipHearingRole = new HearingRole(4, "Defendant LIP");

            defendantLipHearingRole.UserRole = new UserRole(5, "Individual");
            var person1 = new PersonBuilder(true).WithAddress().Build();
            var person2 = new PersonBuilder(true).WithAddress().Build();
            var person3 = new PersonBuilder(true).Build();

            _individualParticipant1               = new Individual(person1, claimantLipHearingRole, claimantCaseRole);
            _individualParticipant1.HearingRole   = claimantLipHearingRole;
            _individualParticipant1.Questionnaire = new Questionnaire
            {
                Participant   = _individualParticipant1,
                ParticipantId = _individualParticipant1.Id
            };
            _individualParticipant1.Questionnaire.AddSuitabilityAnswers(ListOfSuitabilityAnswers());

            _individualParticipant2               = new Individual(person2, defendantLipHearingRole, defendantCaseRole);
            _individualParticipant2.HearingRole   = defendantLipHearingRole;
            _individualParticipant2.Questionnaire = new Questionnaire
            {
                Participant   = _individualParticipant2,
                ParticipantId = _individualParticipant2.Id
            };
            _individualParticipant2.Questionnaire.AddSuitabilityAnswers(ListOfSuitabilityAnswers());

            _representativeParticipant               = new Representative(person3, defendantRepresentativeHearingRole, defendantCaseRole);
            _representativeParticipant.HearingRole   = defendantRepresentativeHearingRole;
            _representativeParticipant.Questionnaire = new Questionnaire
            {
                Participant   = _representativeParticipant,
                ParticipantId = _representativeParticipant.Id
            };
            _representativeParticipant.Questionnaire.AddSuitabilityAnswers(ListOfSuitabilityAnswers());

            _participants.Add(_individualParticipant1);
            _participants.Add(_individualParticipant2);
            _participants.Add(_representativeParticipant);
        }
Beispiel #14
0
        public ParticipantBuilder()
        {
            var applicantCaseRole       = new CaseRole(1, "Applicant");
            var respondentCaseRole      = new CaseRole(2, "Respondent");
            var applicantLipHearingRole = new HearingRole(1, "Litigant in person");

            applicantLipHearingRole.UserRole = new UserRole(5, "Individual");
            var respondentRepresentativeHearingRole = new HearingRole(5, "Representative");

            respondentRepresentativeHearingRole.UserRole = new UserRole(6, "Representative");
            var respondentLipHearingRole = new HearingRole(4, "Litigant in person");

            respondentLipHearingRole.UserRole = new UserRole(5, "Individual");
            var person1 = new PersonBuilder(true).Build();
            var person2 = new PersonBuilder(true).Build();
            var person3 = new PersonBuilder(true).Build();

            _individualParticipant1               = new Individual(person1, applicantLipHearingRole, applicantCaseRole);
            _individualParticipant1.HearingRole   = applicantLipHearingRole;
            _individualParticipant1.Questionnaire = new Questionnaire
            {
                Participant   = _individualParticipant1,
                ParticipantId = _individualParticipant1.Id
            };
            _individualParticipant1.Questionnaire.AddSuitabilityAnswers(ListOfSuitabilityAnswers());

            _individualParticipant2               = new Individual(person2, respondentLipHearingRole, respondentCaseRole);
            _individualParticipant2.HearingRole   = respondentLipHearingRole;
            _individualParticipant2.Questionnaire = new Questionnaire
            {
                Participant   = _individualParticipant2,
                ParticipantId = _individualParticipant2.Id
            };
            _individualParticipant2.Questionnaire.AddSuitabilityAnswers(ListOfSuitabilityAnswers());

            _representativeParticipant               = new Representative(person3, respondentRepresentativeHearingRole, respondentCaseRole);
            _representativeParticipant.HearingRole   = respondentRepresentativeHearingRole;
            _representativeParticipant.Questionnaire = new Questionnaire
            {
                Participant   = _representativeParticipant,
                ParticipantId = _representativeParticipant.Id
            };
            _representativeParticipant.Questionnaire.AddSuitabilityAnswers(ListOfSuitabilityAnswers());

            _participants.Add(_individualParticipant1);
            _participants.Add(_individualParticipant2);
            _participants.Add(_representativeParticipant);
        }
Beispiel #15
0
        public void Should_add_new_participant_to_hearing()
        {
            var hearing          = new VideoHearingBuilder().Build();
            var claimantCaseRole = new CaseRole(1, "Claimant");
            var claimantRepresentativeHearingRole = new HearingRole(2, "Representative");

            var newPerson      = new PersonBuilder(true).Build();
            var beforeAddCount = hearing.GetParticipants().Count;

            hearing.AddRepresentative(newPerson, claimantRepresentativeHearingRole, claimantCaseRole, "Display Name",
                                      string.Empty, string.Empty);

            var afterAddCount = hearing.GetParticipants().Count;

            afterAddCount.Should().BeGreaterThan(beforeAddCount);
        }
Beispiel #16
0
        public void Should_not_remove_participant_that_does_not_exist_in_hearing()
        {
            var hearing = new VideoHearingBuilder().Build();

            var applicantCaseRole = new CaseRole(1, "Applicant");
            var applicantRepresentativeHearingRole = new HearingRole(2, "Representative");
            var newPerson   = new PersonBuilder(true).Build();
            var participant = Builder <Representative> .CreateNew().WithFactory(() =>
                                                                                new Representative(newPerson, applicantRepresentativeHearingRole, applicantCaseRole)
                                                                                ).Build();

            Action action = () => hearing.RemoveParticipant(participant);

            action.Should().Throw <DomainRuleException>().And.ValidationFailures.Any(x =>
                                                                                     x.Name == "Participant" && x.Message == "Participant does not exist on the hearing").Should().BeTrue();
        }
        public Participant AddJudicialOfficeHolder(Person person, HearingRole hearingRole, CaseRole caseRole, string displayName)
        {
            if (DoesParticipantExist(person.Username))
            {
                throw new DomainRuleException(nameof(person), "Judicial office holder already exists in the hearing");
            }

            var participant = new JudicialOfficeHolder(person, hearingRole, caseRole)
            {
                DisplayName = displayName
            };

            Participants.Add(participant);
            UpdatedDate = DateTime.Now;
            return(participant);
        }
        public Participant AddJudge(Person person, HearingRole hearingRole, CaseRole caseRole, string displayName)
        {
            if (DoesParticipantExist(person.Username))
            {
                throw new DomainRuleException(nameof(person), "Judge with given username already exists in the hearing");
            }

            Participant participant = new Judge(person, hearingRole, caseRole)
            {
                DisplayName = displayName,
                CreatedBy   = CreatedBy
            };

            Participants.Add(participant);
            UpdatedDate = DateTime.UtcNow;
            return(participant);
        }
        public Participant AddRepresentative(Person person, HearingRole hearingRole, CaseRole caseRole, string displayName,
                                             string representee)
        {
            if (DoesParticipantExist(person.Username))
            {
                throw new DomainRuleException(nameof(person), "Participant already exists in the hearing");
            }

            Participant participant = new Representative(person, hearingRole, caseRole)
            {
                Representee = representee
            };

            participant.DisplayName = displayName;
            participant.CreatedBy   = CreatedBy;
            Participants.Add(participant);
            UpdatedDate = DateTime.UtcNow;
            return(participant);
        }
        private static void AssertParticipantCommonDetails(ParticipantResponse response, Participant participant,
                                                           CaseRole caseRole, HearingRole hearingRole)
        {
            response.Id.Should().Be(participant.Id);
            response.DisplayName.Should().Be(participant.DisplayName);
            response.CaseRoleName.Should().Be(caseRole.Name);
            response.HearingRoleName.Should().Be(hearingRole.Name);
            response.UserRoleName.Should().Be(hearingRole.UserRole.Name);

            var person = participant.Person;

            response.Title.Should().Be(person.Title);
            response.FirstName.Should().Be(person.FirstName);
            response.MiddleNames.Should().Be(person.MiddleNames);
            response.LastName.Should().Be(person.LastName);

            response.ContactEmail.Should().Be(person.ContactEmail);
            response.TelephoneNumber.Should().Be(person.TelephoneNumber);
            response.Username.Should().Be(person.Username);
        }
Beispiel #21
0
        public void Should_map_all_without_judge()
        {
            var @case          = hearingsByCaseNumber[0].GetCases().FirstOrDefault();
            var newHearingRole = new HearingRole(1, "Name")
            {
                UserRole = new UserRole(1, "Winger"),
            };

            hearingsByCaseNumber[0].GetParticipants().FirstOrDefault(s => s.HearingRole?.UserRole?.Name == "Judge").HearingRole = newHearingRole;

            var result = hearingMapper.MapHearingToDetailedResponse(hearingsByCaseNumber, string.Empty);

            result[0].CaseName.Should().Be(@case.Name);
            result[0].CaseNumber.Should().Be(@case.Number);
            result[0].Id.Should().Be(hearingsByCaseNumber[0].Id);
            result[0].ScheduledDateTime.Should().Be(hearingsByCaseNumber[0].ScheduledDateTime);
            result[0].HearingVenueName.Should().Be(hearingsByCaseNumber[0].HearingVenueName);
            result[0].CourtroomAccount.Should().Be(string.Empty);
            result[0].CourtroomAccountName.Should().Be(string.Empty);
            result[0].HearingRoomName.Should().Be(hearingsByCaseNumber[0].HearingRoomName);
        }
Beispiel #22
0
        public void Should_map_judicial_office_holder()
        {
            var caseRole    = new CaseRole(7, "Judicial Office Holder");
            var hearingRole = new HearingRole(14, "Judicial Office Holder")
            {
                UserRole = new UserRole(7, "Judicial Office Holder")
            };

            var person = new PersonBuilder().Build();
            var joh    = new JudicialOfficeHolder(person, hearingRole, caseRole)
            {
                DisplayName = "JOH",
                CreatedBy   = "*****@*****.**"
            };

            joh.SetProtected(nameof(joh.CaseRole), caseRole);
            joh.SetProtected(nameof(joh.HearingRole), hearingRole);

            var response = _mapper.MapParticipantToResponse(joh);

            AssertParticipantCommonDetails(response, joh, caseRole, hearingRole);
            AssertRepresentativeResponse(response, null);
            response.Organisation.Should().BeNullOrWhiteSpace();
        }
Beispiel #23
0
 public StaffMember(Person person, HearingRole hearingRole, CaseRole caseRole)
     : base(person, hearingRole, caseRole)
 {
 }
 public Representative(Person person, HearingRole hearingRole, CaseRole caseRole) : base(person, hearingRole,
                                                                                         caseRole)
 {
 }
Beispiel #25
0
        public VideoHearingBuilder()
        {
            var refDataBuilder = new RefDataBuilder();
            var venue          = refDataBuilder.HearingVenues.First(x => x.Name == _hearingVenueName);
            var caseType       = new CaseType(1, _caseTypeName);
            var hearingType    = Builder <HearingType> .CreateNew().WithFactory(() => new HearingType(_hearingTypeName)).Build();

            var        scheduledDateTime        = DateTime.Today.AddDays(1).AddHours(11).AddMinutes(45);
            var        duration                 = 80;
            var        hearingRoomName          = "Roome03";
            var        otherInformation         = "OtherInformation03";
            var        createdBy                = "User03";
            const bool questionnaireNotRequired = false;
            const bool audioRecordingRequired   = true;
            var        cancelReason             = "Online abandonment (incomplete registration)";

            _videoHearing = Builder <VideoHearing> .CreateNew().WithFactory(() =>
                                                                            new VideoHearing(caseType, hearingType, scheduledDateTime, duration, venue, hearingRoomName,
                                                                                             otherInformation, createdBy, questionnaireNotRequired, audioRecordingRequired, cancelReason))
                            .Build();

            var applicantCaseRole = new CaseRole(1, "Applicant")
            {
                Group = CaseRoleGroup.Applicant
            };
            var respondentCaseRole = new CaseRole(2, "Respondent")
            {
                Group = CaseRoleGroup.Respondent
            };
            var applicantLipHearingRole = new HearingRole(1, "Litigant in person")
            {
                UserRole = new UserRole(1, "Individual")
            };
            var respondentRepresentativeHearingRole = new HearingRole(5, "Representative")
            {
                UserRole = new UserRole(1, "Representative")
            };

            var respondentLipHearingRole = new HearingRole(4, "Litigant in person")
            {
                UserRole = new UserRole(1, "Individual")
            };
            var judgeCaseRole = new CaseRole(5, "Judge")
            {
                Group = CaseRoleGroup.Judge
            };
            var judgeHearingRole = new HearingRole(13, "Judge")
            {
                UserRole = new UserRole(1, "Judge")
            };
            var johHearingRole = new HearingRole(14, "Judicial Office Holder")
            {
                UserRole = new UserRole(7, "Judicial Office Holder")
            };
            var johCaseRole = new CaseRole(11, "Winger")
            {
                Group = CaseRoleGroup.Winger
            };

            var person1 = new PersonBuilder(true).Build();
            var person2 = new PersonBuilder(true).Build();
            var person3 = new PersonBuilder(true).Build();

            _judgePerson = new PersonBuilder(true).Build();
            _johPerson   = new PersonBuilder(true).Build();

            _videoHearing.AddIndividual(person1, applicantLipHearingRole, applicantCaseRole,
                                        $"{person1.FirstName} {person1.LastName}");
            var indApplicant = _videoHearing?.Participants.Last();

            indApplicant.SetProtected(nameof(indApplicant.CaseRole), applicantCaseRole);
            indApplicant.SetProtected(nameof(indApplicant.HearingRole), applicantLipHearingRole);

            _videoHearing.AddIndividual(person3, respondentLipHearingRole, respondentCaseRole,
                                        $"{person3.FirstName} {person3.LastName}");
            var indRespondent = _videoHearing?.Participants.Last();

            indRespondent.SetProtected(nameof(indApplicant.CaseRole), respondentCaseRole);
            indRespondent.SetProtected(nameof(indRespondent.HearingRole), respondentLipHearingRole);

            _videoHearing.AddRepresentative(person2, respondentRepresentativeHearingRole, respondentCaseRole,
                                            $"{person2.FirstName} {person2.LastName}", string.Empty);
            var repRespondent = _videoHearing?.Participants.Last();

            repRespondent.SetProtected(nameof(indApplicant.CaseRole), respondentCaseRole);
            repRespondent.SetProtected(nameof(repRespondent.HearingRole), respondentRepresentativeHearingRole);

            _videoHearing.AddJudge(_judgePerson, judgeHearingRole, judgeCaseRole,
                                   $"{_judgePerson.FirstName} {_judgePerson.LastName}");
            var judge = _videoHearing?.Participants.Last();

            judge.SetProtected(nameof(indApplicant.CaseRole), judgeCaseRole);
            judge.SetProtected(nameof(judge.HearingRole), judgeHearingRole);

            _videoHearing.AddJudicialOfficeHolder(_johPerson, johHearingRole, johCaseRole,
                                                  $"{_johPerson.FirstName} {_johPerson.LastName}");
            var joh = _videoHearing?.Participants.Last();

            joh.SetProtected(nameof(indApplicant.CaseRole), johCaseRole);
            joh.SetProtected(nameof(joh.HearingRole), johHearingRole);

            // Set the navigation properties as well since these would've been set if we got the hearing from DB
            _videoHearing.SetProtected(nameof(_videoHearing.HearingType), hearingType);
            _videoHearing.SetProtected(nameof(_videoHearing.CaseType), caseType);
            _videoHearing.SetProtected(nameof(_videoHearing.HearingVenue), venue);
        }
Beispiel #26
0
 public JudicialOfficeHolder(Person person, HearingRole hearingRole, CaseRole caseRole) : base(person, hearingRole,
                                                                                               caseRole)
 {
 }
Beispiel #27
0
 public Judge(Person person, HearingRole hearingRole, CaseRole caseRole)
     : base(person, hearingRole, caseRole)
 {
 }
 public bool IsWitness()
 {
     return(HearingRole.Trim().Equals("witness", StringComparison.CurrentCultureIgnoreCase));
 }
 public Individual(Person person, HearingRole hearingRole, CaseRole caseRole) : base(person, hearingRole,
                                                                                     caseRole)
 {
 }