class PasswordRecoveryServiceImpl implements PasswordRecoveryService {

    @Transactional
    @Override
    public void sendPasswordRecoveryEmailTo(String email) {
        User user = userRepo
            .findByEmail(email)
            .orElseThrow(() -> new NotFoundException(ErrorMessage.USER_NOT_FOUND_BY_EMAIL + email));
        RestorePasswordEmail restorePasswordEmail = user.getRestorePasswordEmail();
        if (restorePasswordEmail != null) {
            throw new WrongEmailException(PASSWORD_RESTORE_LINK_ALREADY_SENT + email);
        }
        savePasswordRestorationTokenForUser(user, jwtTool.generateTokenKey());
    }

    public  PasswordRecoveryServiceImpl(
        RestorePasswordEmailRepo restorePasswordEmailRepo,
        UserRepo userRepo,
        ApplicationEventPublisher applicationEventPublisher,
        RabbitTemplate rabbitTemplate,
        JwtTool jwtTool
    );

}