package repository

import (
	"context"
	"time"

	memberdomain "gateway/internal/model/member/domain"
)

// StepUpSession binds a verified step-up token to tenant/member/purpose.
type StepUpSession struct {
	TokenID  string
	TenantID string
	UID      string
	Purpose  string
}

// StepUpStore persists short-lived step-up sessions after TOTP verify.
type StepUpStore interface {
	Save(ctx context.Context, session *StepUpSession, ttl time.Duration) error
	Get(ctx context.Context, tokenID string) (*StepUpSession, error)
	Delete(ctx context.Context, tokenID string) error
}

// StepUpRedisKey re-exports the Redis key helper for tests.
func StepUpRedisKey(tokenID string) string {
	return memberdomain.GetStepUpRedisKey(tokenID)
}
