protected override bool DoHandle(User user, Candidate candidate)
        {
            if (user == null || candidate == null)
            {
                return(false);
            }

            if (user.Status != UserStatuses.Dormant)
            {
                return(false);
            }

            var housekeepingCyclesSinceLastLogin = GetHousekeepingCyclesSince(user.GetLastLogin());

            if (housekeepingCyclesSinceLastLogin >= Configuration.DormantAccountStrategy.SetPendingDeletionAfterCycles)
            {
                var existingUser = _userReadRepository.Get(user.Username, false);

                if (existingUser == null || !existingUser.IsInState(UserStatuses.PendingDeletion))
                {
                    return(_setUserStatusPendingDeletionStrategy.SetUserStatusPendingDeletion(user));
                }
            }

            return(false);
        }
        public bool SetCandidateDeletionPending(Candidate candidate)
        {
            Condition.Requires(candidate);
            _logger.Info(
                $"Calling CandidateService to Set status to Deletion Pending for account of the user with Id={candidate.EntityId}");
            var user = _userReadRepository.Get(candidate.EntityId);

            return(user != null && _setCandidateDeletionPendingStrategy.SetUserStatusPendingDeletion(user));
        }