Files
warmbly/internal/repository/sequence_actions.go
T
Matthew Meszaros da82993846 feat: add campaign workflow backend support
Add sequence action-node storage and execution, template conditional rendering, lead progress state, profile updates, webhook fan-out throttling, and supporting repository fixes.
2026-06-06 07:49:52 +02:00

26 lines
869 B
Go

package repository
import (
"github.com/warmbly/warmbly/internal/errx"
"github.com/warmbly/warmbly/internal/models"
)
// validateActionConfig checks a non-email (action/wait) node's typed config
// before it is persisted. This is a shape gate only; the kind↔action pairing and
// cross-step routing targets are handled elsewhere (the canvas sets kind+action
// together, and dangling routes resolve to "stop" at schedule time).
func validateActionConfig(a *models.ActionConfig) *errx.Error {
if a == nil {
return nil
}
switch a.Type {
case "wait", "add_tag", "remove_tag", "unsubscribe", "notify", "end":
// Type must be known. Sub-config (wait minutes, tag) is filled in the
// editor; an unconfigured node is a harmless no-op at send time, so we
// don't block creating a draft node here.
return nil
default:
return errx.ErrSequenceAction
}
}