package service

import (
	"github.com/codex-k8s/kodex/libs/go/accesscatalog"
	fleetevents "github.com/codex-k8s/kodex/libs/go/platformevents/fleet"
)

const (
	platformDefaultKey = "platform-default"

	fleetEventScopeCreated      = fleetevents.EventScopeCreated
	fleetEventScopeUpdated      = fleetevents.EventScopeUpdated
	fleetEventScopeDisabled     = fleetevents.EventScopeDisabled
	fleetEventScopeEnabled      = fleetevents.EventScopeEnabled
	fleetEventServerCreated     = fleetevents.EventServerCreated
	fleetEventServerUpdated     = fleetevents.EventServerUpdated
	fleetEventServerDisabled    = fleetevents.EventServerDisabled
	fleetEventServerEnabled     = fleetevents.EventServerEnabled
	fleetEventClusterCreated    = fleetevents.EventClusterCreated
	fleetEventClusterUpdated    = fleetevents.EventClusterUpdated
	fleetEventClusterDisabled   = fleetevents.EventClusterDisabled
	fleetEventClusterEnabled    = fleetevents.EventClusterEnabled
	fleetEventHealthChecked     = fleetevents.EventHealthChecked
	fleetEventHealthDegraded    = fleetevents.EventHealthDegraded
	fleetEventPlacementResolved = fleetevents.EventPlacementResolved
	fleetEventPlacementRejected = fleetevents.EventPlacementRejected

	fleetAggregateScope             = fleetevents.AggregateFleetScope
	fleetAggregateServer            = fleetevents.AggregateServer
	fleetAggregateCluster           = fleetevents.AggregateKubernetesCluster
	fleetAggregateHealth            = fleetevents.AggregateClusterHealth
	fleetAggregatePlacementRule     = "placement_rule"
	fleetAggregatePlacementDecision = fleetevents.AggregatePlacementDecision

	fleetOperationCreateScope      = "domain.Service.CreateFleetScope"
	fleetOperationUpdateScope      = "domain.Service.UpdateFleetScope"
	fleetOperationDisableScope     = "domain.Service.DisableFleetScope"
	fleetOperationEnableScope      = "domain.Service.EnableFleetScope"
	fleetOperationRegisterServer   = "domain.Service.RegisterServer"
	fleetOperationUpdateServer     = "domain.Service.UpdateServer"
	fleetOperationDisableServer    = "domain.Service.DisableServer"
	fleetOperationEnableServer     = "domain.Service.EnableServer"
	fleetOperationRegisterCluster  = "domain.Service.RegisterKubernetesCluster"
	fleetOperationUpdateCluster    = "domain.Service.UpdateKubernetesCluster"
	fleetOperationDisableCluster   = "domain.Service.DisableKubernetesCluster"
	fleetOperationEnableCluster    = "domain.Service.EnableKubernetesCluster"
	fleetOperationRunHealthCheck   = "domain.Service.RunClusterConnectivityCheck"
	fleetOperationPutPlacementRule = "domain.Service.PutPlacementRule"
	fleetOperationResolvePlacement = "domain.Service.ResolvePlacement"

	fleetActionScopeCreate           = accesscatalog.ActionFleetScopeCreate
	fleetActionScopeUpdate           = accesscatalog.ActionFleetScopeUpdate
	fleetActionScopeDisable          = accesscatalog.ActionFleetScopeDisable
	fleetActionScopeEnable           = accesscatalog.ActionFleetScopeEnable
	fleetActionScopeRead             = accesscatalog.ActionFleetScopeRead
	fleetActionScopeList             = accesscatalog.ActionFleetScopeList
	fleetActionServerRegister        = accesscatalog.ActionFleetServerRegister
	fleetActionServerUpdate          = accesscatalog.ActionFleetServerUpdate
	fleetActionServerDisable         = accesscatalog.ActionFleetServerDisable
	fleetActionServerEnable          = accesscatalog.ActionFleetServerEnable
	fleetActionServerRead            = accesscatalog.ActionFleetServerRead
	fleetActionServerList            = accesscatalog.ActionFleetServerList
	fleetActionClusterRegister       = accesscatalog.ActionFleetClusterRegister
	fleetActionClusterUpdate         = accesscatalog.ActionFleetClusterUpdate
	fleetActionClusterDisable        = accesscatalog.ActionFleetClusterDisable
	fleetActionClusterEnable         = accesscatalog.ActionFleetClusterEnable
	fleetActionClusterRead           = accesscatalog.ActionFleetClusterRead
	fleetActionClusterList           = accesscatalog.ActionFleetClusterList
	fleetActionHealthCheckRun        = accesscatalog.ActionFleetHealthCheckRun
	fleetActionHealthRead            = accesscatalog.ActionFleetHealthRead
	fleetActionPlacementRulePut      = accesscatalog.ActionFleetPlacementRulePut
	fleetActionPlacementRuleRead     = accesscatalog.ActionFleetPlacementRuleRead
	fleetActionPlacementRuleList     = accesscatalog.ActionFleetPlacementRuleList
	fleetActionPlacementResolve      = accesscatalog.ActionFleetPlacementResolve
	fleetActionPlacementDecisionRead = accesscatalog.ActionFleetPlacementDecisionRead
	fleetActionPlacementDecisionList = accesscatalog.ActionFleetPlacementDecisionList
)

type resourceRef struct {
	Type      string
	ID        string
	ScopeType string
	ScopeID   string
}
