mirror of
https://github.com/warmbly/warmbly.git
synced 2026-09-11 16:08:09 +00:00
Add sequence action-node storage and execution, template conditional rendering, lead progress state, profile updates, webhook fan-out throttling, and supporting repository fixes.
26 lines
869 B
Go
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
|
|
}
|
|
}
|