package dag

import (
	flowentity "github.com/tidbcloud/fastflow/pkg/entity"

	"github.com/tidbcloud/tidb-management-service/tidb-mgmt-service/domain/constant"
	"github.com/tidbcloud/tidb-management-service/utilities/workflow"
)

func DeleteDedicatedClusterDag() *flowentity.Dag {
	dag := &flowentity.Dag{
		BaseInfo: flowentity.BaseInfo{
			ID: constant.DagDedicatedDeleteCluster,
		},
		Name:   constant.DagDedicatedDeleteCluster,
		Status: flowentity.DagStatusNormal,
		Vars: map[string]flowentity.DagVar{
			constant.KeyRequest:     {},
			constant.KeyFinalBackup: {},
			workflow.KeyTraceId:     {},
			workflow.KeySpanName:    {},
			workflow.KeyRequestMeta: {},
		},
		Tasks: []flowentity.Task{
			// TODO add disable endppoint task
			{
				ID:         constant.TaskDedicatedClusterFinalBackup,
				ActionName: constant.TaskDedicatedClusterFinalBackup,
			},
			{
				ID:         constant.TaskDedicatedGlobalDeleteCluster,
				ActionName: constant.TaskDedicatedGlobalDeleteCluster,
				DependOn:   []string{constant.TaskDedicatedClusterFinalBackup},
			},
		},
	}

	return dag
}
