private ProfessionalContactDegree GetContactDegree(OrganisationHierarchyPath organisationHierarchyPath, Guid contenderId) { return(IsApplicant(organisationHierarchyPath, contenderId) ? ProfessionalContactDegree.Applicant : _exercisedCreditsQuery.HasExercisedCredit <ContactCredit>(organisationHierarchyPath, contenderId) ? ProfessionalContactDegree.Contacted : ProfessionalContactDegree.NotContacted); }
private IList <Guid> GetApplicants(OrganisationHierarchyPath organisationHierarchyPath, IEnumerable <Guid> contenderIds) { var applicants = from c in _exercisedCreditsQuery.GetExercisedCredits <ApplicantCredit>(organisationHierarchyPath, contenderIds) select c.ExercisedOnId.Value; if (organisationHierarchyPath.RecruiterId != null) { applicants = applicants.Concat(_repository.GetOwnerApplicants(organisationHierarchyPath.RecruiterId.Value, contenderIds)); } return(applicants.Distinct().ToList()); }
private bool IsApplicant(OrganisationHierarchyPath organisationHierarchyPath, Guid contenderId) { // Before the organisational hierarchy was in place we didn't explicitly record using credits for applicants. // Use the credits to find those applicants to jobs in the organisational hierarchy // but also use the repository to look for those who applied to jobs from the recruiter themselves before // this was put in place. if (_exercisedCreditsQuery.HasExercisedCredit <ApplicantCredit>(organisationHierarchyPath, contenderId)) { return(true); } if (organisationHierarchyPath.RecruiterId != null) { return(_repository.IsOwnerApplicant(organisationHierarchyPath.RecruiterId.Value, contenderId)); } return(false); }
bool IContendersQuery.IsApplicant(OrganisationHierarchyPath organisationHierarchyPath, Guid contenderId) { return(IsApplicant(organisationHierarchyPath, contenderId)); }
IList <Guid> IContendersQuery.GetApplicants(OrganisationHierarchyPath organisationHierarchyPath, IEnumerable <Guid> contenderIds) { return(GetApplicants(organisationHierarchyPath, contenderIds)); }
IList <Guid> IContendersQuery.GetApplicants(OrganisationHierarchyPath organisationHierarchyPath) { return(GetApplicants(organisationHierarchyPath).ToList()); }
ProfessionalContactDegree IContendersQuery.GetContactDegree(OrganisationHierarchyPath organisationHierarchyPath, Guid contenderId) { return(GetContactDegree(organisationHierarchyPath, contenderId)); }