package repository

import (
	"context"
	"time"

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

// LoginSession holds OAuth login-only state in Redis.
type LoginSession struct {
	SessionID   string
	TenantID    string
	TenantSlug  string
	Provider    string
	RedirectURI string
}

// LoginSessionStore persists short-lived login sessions.
type LoginSessionStore interface {
	Save(ctx context.Context, session *LoginSession, ttl time.Duration) error
	Get(ctx context.Context, sessionID string) (*LoginSession, error)
	Delete(ctx context.Context, sessionID string) error
}

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