package repository

import (
	"context"
	"time"

	authdomain "gateway/internal/model/auth/domain"
)

// LoginMFAChallenge holds pending password-login state after credentials pass.
type LoginMFAChallenge struct {
	ChallengeID string
	TenantID    string
	TenantSlug  string
	UID         string
}

// LoginMFAChallengeStore persists short-lived login MFA challenges.
type LoginMFAChallengeStore interface {
	Save(ctx context.Context, challenge *LoginMFAChallenge, ttl time.Duration) error
	Get(ctx context.Context, challengeID string) (*LoginMFAChallenge, error)
	Delete(ctx context.Context, challengeID string) error
}

// LoginMFAChallengeRedisKey re-exports the Redis key helper for tests.
func LoginMFAChallengeRedisKey(challengeID string) string {
	return authdomain.LoginMFAChallengeRedisKey(challengeID)
}
