예제 #1
0
 public CandidateSearchModel MapToCandidateSearchModel(JobOffer offer)
 {
     if (offer != null)
     {
         var skills = MapSkillsToSkillModels(offer.Skills);
         var candidateSearchModel = new CandidateSearchModel(skills, offer.Salary);
         return candidateSearchModel;
     }
     else
     {
         return new CandidateSearchModel();
     }
 }
예제 #2
0
        public async Task UpdateJobOfferAsync(JobOffer offer, string offerId)
        {
            var filter = Builders<JobOffer>.Filter.Eq(r => r.Id, offerId);
            var update = Builders<JobOffer>
                .Update
                .Set(r => r.Name, offer.Name)
                .Set(r => r.Salary, offer.Salary)
                .Set(r => r.Skills, offer.Skills)
                .Set(r => r.Description, offer.Description)
                .Set(r => r.ModificationDate, offer.ModificationDate);

            await dbContext.JobOffers.UpdateOneAsync(filter, update);
        }
예제 #3
0
 public async Task InsertJobOfferAsync(JobOffer offer)
 {
     await dbContext.JobOffers.InsertOneAsync(offer);
 }
        public async Task CanGetJobOfferById()
        {
            JobOffer jobOffer = new JobOffer()
            {
                Name = "AA",
                Salary = 11,
                RecruiterId = "22222",
                Description = "Description",
                Skills = new List<Skill>() { new Skill() { Name = "C++", Level = 5 } }
            };

            dbService
                .Setup(r => r.GetJobOfferByIdAsync(It.IsAny<string>()))
                .Returns(Task<JobOffer>.FromResult(jobOffer));

            var result = await applicationService.GetJobOfferByIdAsync("11111");

            Assert.AreEqual(jobOffer.Name, result.Name);
        }
예제 #5
0
 public ScoredOfferModel MapToScoredOfferModel(JobOffer offer, double score)
 {
     var skills = MapSkillsToSkillModels(offer.Skills);
     var scoredOfferModel = new ScoredOfferModel(offer.Id, offer.Name, offer.Salary, score, offer.Description, skills);
     return scoredOfferModel;
 }
예제 #6
0
 public OfferModel MapToOfferModel(JobOffer offer)
 {
     var skills = MapSkillsToSkillModels(offer.Skills);
     var offerModel = new OfferModel(offer.Id, offer.Name, offer.Salary, offer.Description, skills);
     return offerModel;
 }
예제 #7
0
 public JobOffer MapToJobOffer(OfferModel model, string id)
 {
     var skills = MapSkillModelsToSkills(model.Skills);
     var offer = new JobOffer(model.Name, model.Salary, id, model.Description, skills);
     return offer;
 }
예제 #8
0
 public ScoredOfferViewModel GetScoredOfferViewModel(double score, JobOffer offer)
 {
     var scoredOfferModel = _mappingService.MapToScoredOfferModel(offer, score);
     var scoredOfferViewModel = _mappingService.MapToScoredOfferViewModel(scoredOfferModel, offer.ModificationDate);
     return scoredOfferViewModel;
 }
예제 #9
0
 private void GenerateOffersForRecruiter(int numberOfOffersForRecruiter, string recruiterName, int recuiterNumber, string recruiterId, Random random)
 {
     for (int j = 0; j < numberOfOffersForRecruiter; j++)
     {
         var skillList = GenerateSkillList(random);
         var offer = new JobOffer()
         {
             RecruiterId = recruiterId,
             ModificationDate = DateTime.UtcNow,
             Name = "Recruiter " + recruiterName + recuiterNumber + ": Offer " + j,
             Salary = random.Next(1000, 20000),
             Skills = skillList,
         };
         _databaseService.InsertJobOfferAsync(offer);
     }
 }