package model

import (
	"context"

	"github.com/SigNoz/signoz/pkg/types/opamptypes"
	"github.com/SigNoz/signoz/pkg/valuer"
)

// Interface for source of otel collector config recommendations.
type AgentConfigProvider interface {
	// Generate recommended config for an agent based on its `currentConfYaml`
	// and current state of user facing settings for agent based features.
	RecommendAgentConfig(orgId valuer.UUID, currentConfYaml []byte) (
		recommendedConfYaml []byte,
		// Opaque id of the recommended config, used for reporting deployment status updates
		configId string,
		err error,
	)

	// Report deployment status for config recommendations generated by RecommendAgentConfig
	ReportConfigDeploymentStatus(
		orgId valuer.UUID,
		agentId string,
		configId string,
		err error,
	)

	// GetDeployStatusByHash returns the DeployStatus for the given config hash
	// (with orgId prefix as stored in the DB). Returns DeployStatusUnknown when
	// no matching row exists. Used by the agent's first-connect handler to
	// determine whether the reported RemoteConfigStatus resolves a pending deployment.
	GetDeployStatusByHash(ctx context.Context, orgId valuer.UUID, configHash string) (opamptypes.DeployStatus, error)
}
