package site

import (
	"context"

	"github.com/gocql/gocql"
	"go.uber.org/zap"

	siteusecase "codeberg.org/mapleopentech/monorepo/cloud/maplepress-backend/internal/usecase/site"
)

// ListSitesService handles listing sites
type ListSitesService interface {
	ListSites(ctx context.Context, tenantID gocql.UUID, input *siteusecase.ListSitesInput) (*siteusecase.ListSitesOutput, error)
}

type listSitesService struct {
	listUC *siteusecase.ListSitesUseCase
	logger *zap.Logger
}

// NewListSitesService creates a new ListSitesService
func NewListSitesService(
	listUC *siteusecase.ListSitesUseCase,
	logger *zap.Logger,
) ListSitesService {
	return &listSitesService{
		listUC: listUC,
		logger: logger.Named("list-sites-service"),
	}
}

// ListSites retrieves all sites for a tenant
func (s *listSitesService) ListSites(ctx context.Context, tenantID gocql.UUID, input *siteusecase.ListSitesInput) (*siteusecase.ListSitesOutput, error) {
	return s.listUC.Execute(ctx, tenantID, input)
}
