Exemplo n.º 1
0
        private string ResolveCandidateName(ApiJobApplication src)
        {
            string unknown = "Unknown";

            if (src == null)
            {
                return(unknown);
            }
            var candidate = GreenHouseDataStore.Instance.Candidates.FirstOrDefault(c => c.Id == src.CandidateId);

            return(candidate != null?candidate.GetFullName() : unknown);
        }
Exemplo n.º 2
0
        private string ResolveJobName(ApiJobApplication src)
        {
            string unknown = "Unknown";

            if (src == null || src.Jobs.FirstOrDefault() == null)
            {
                return(unknown);
            }

            //var job = GreenHouseDataStore.Instance.Jobs.First(j => j.Id == src.Jobs.FirstOrDefault().Id);
            //return job.Name;
            return(src.Jobs.FirstOrDefault().Name);
        }
Exemplo n.º 3
0
        private bool IsNewApplicant(ApiJobApplication applicant, ApiJob[] openingJobs)
        {
            /*var openingJobIds = openingJobs.Select(job => job.Id);
             * return applicant != null && applicant.RejectedAt == null
             *  && applicant.CurrentStage != null && !string.IsNullOrEmpty(applicant.CurrentStage.Name) && applicant.CurrentStage.Name == ApplicationStages.ApplicationReviewCV
             *  && applicant.Jobs != null && applicant.Jobs.FirstOrDefault() != null && openingJobIds.Contains(applicant.Jobs.FirstOrDefault().Id);*/
            var openingJobsLinks = openingJobs.Select(job => job.GetCustomFieldValue(JobCustomFields.ResourceUrl));

            return(applicant != null && applicant.RejectedAt == null &&
                   applicant.CurrentStage != null && !string.IsNullOrEmpty(applicant.CurrentStage.Name) &&
                   applicant.CurrentStage.Name == ApplicationStages.ApplicationReviewCV &&
                   applicant.Jobs != null && applicant.Jobs.FirstOrDefault() != null &&
                   applicant.Jobs.FirstOrDefault().GetCustomFieldValue(JobCustomFields.ResourceUrl) !=
                   ApiJob.UnknownCustomValue
                   &&
                   openingJobsLinks.Contains(
                       applicant.Jobs.FirstOrDefault().GetCustomFieldValue(JobCustomFields.ResourceUrl)));
        }
Exemplo n.º 4
0
        private string ResolveJobId(ApiJobApplication src)
        {
            var emptyId = "0";

            if (src == null || src.Jobs.FirstOrDefault() == null)
            {
                return(emptyId);
            }
            //we must resolve id by RecourceUrl, because RecruiterBox doesn't give us application job id
            //var job = GreenHouseDataStore.Instance.Jobs.First(j => j.Name == src.Jobs.FirstOrDefault().Name);
            var srcJobResourceUrl = src.Jobs.FirstOrDefault()?.GetCustomFieldValue(JobCustomFields.ResourceUrl);

            if (string.IsNullOrEmpty(srcJobResourceUrl) || srcJobResourceUrl == ApiJob.UnknownCustomValue)
            {
                return(emptyId);
            }
            var job = GreenHouseDataStore.Instance.Jobs.FirstOrDefault(j => j.GetCustomFieldValue(JobCustomFields.ResourceUrl) == srcJobResourceUrl);

            if (job == null)
            {
                return(emptyId);
            }
            return(job.Id);
        }