package marketing

import "time"

// ClinicHandler provides access to the PingCAP Clinic API for cluster discovery and metrics.
type ClinicHandler interface {
	// GetTenantClusterIDs returns active cluster IDs for a given tenant.
	GetTenantClusterIDs(tenantID uint) ([]string, error)
	// GetClusterRequests returns the total request count for a cluster in the given time window.
	GetClusterRequests(clusterID string, start, end time.Time) (float64, error)
}

// GetClinicHandler returns the global clinic handler instance.
func GetClinicHandler() ClinicHandler {
	return globalClinicHandler
}

// SetClinicHandler allows overriding the handler for testing.
func SetClinicHandler(handler ClinicHandler) {
	globalClinicHandler = handler
}

var globalClinicHandler ClinicHandler = &ClinicHandlerImpl{}
