package org.raddatz.familienarchiv.user;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * E2E-only thin wrapper around {@link PasswordResetService} that exposes
 * the latest active reset token for a given email. Loaded only when the
 * {@code e2e} Spring profile is active so production code paths never see it.
 */
@Service
@Profile("e2e")
@RequiredArgsConstructor
public class PasswordResetTestHelper {

    private final PasswordResetService passwordResetService;

    public Optional<String> getResetTokenForTest(String email) {
        return passwordResetService.findLatestActiveTokenForEmail(email);
    }
}
