package taskruns

import "github.com/pingcap/test-infra/common/model"

type TaskRunPhase string

const (
	PhaseUnknown TaskRunPhase = ""
	PhasePending TaskRunPhase = "PENDING"
	PhaseRunning TaskRunPhase = "RUNNING"
	PhaseCompleted TaskRunPhase = "COMPLETED"
)

type TaskRunStatus struct {
	Underlying *Underlying   `json:"underlying,omitempty"`
	Phase      TaskRunPhase  `json:"phase"`
	OutPuts    []OutputParam `json:"outPuts"`
}

type Underlying struct {
	Argo *ArgoRef `json:"argo,omitempty"`
}


type ArgoRef struct {
	Namespace    string `json:"namespace"`
	Workflow     string `json:"workflow"`
	NodeID       string `json:"nodeId"`
	TemplateName string `json:"templateName"`
}

type TaskRunSpec struct {
	Parent *TaskRunRef `json:"parent,omitempty"`
}

type TaskRunRef struct {
	PlanRunID         *model.ID `json:"planRunID,omitempty"`
	TestbedSetupRunID *model.ID `json:"testbedSetupRunID,omitempty"`
	CaseRunID         *model.ID `json:"caseRunID,omitempty"`
}
