package services

import (
	"fmt"

	"gitea.hostxtra.co.uk/mrhid6/vantage/server/internal/models"
)

func ValidateWorkflow(w models.Workflow) error {
	for i, ref := range w.Steps {
		hasLib := ref.StepID != ""
		hasInline := ref.Inline != nil
		if hasLib == hasInline {
			return fmt.Errorf("step %d: exactly one of step_id or inline must be set", i)
		}
	}
	return nil
}
