Beispiel #1
0
        public void GetCandidatesPendingMagicLinkTokenGeneration_ReturnsCorrectly()
        {
            _mockService.Setup(m => m.CreateQuery("contact", _context))
            .Returns(MockCandidates());

            var result = _crm.GetCandidatesPendingMagicLinkTokenGeneration();

            result.Select(c => c.MagicLinkTokenStatusId).Should().AllBeEquivalentTo((int)Candidate.MagicLinkTokenStatus.Pending);
        }
Beispiel #2
0
        private void GenerateTokens()
        {
            var candidates = _crm.GetCandidatesPendingMagicLinkTokenGeneration(BatchSize);

            _logger.LogInformation($"MagicLinkTokenGenerationJob - Processing ({candidates.Count()})");

            foreach (var candidate in candidates)
            {
                _magicLinkTokenService.GenerateToken(candidate);
                string json = candidate.SerializeChangeTracked();
                _jobClient.Enqueue <UpsertCandidateJob>(x => x.Run(json, null));
            }
        }