Files
warmbly/internal/app/sequence/handler.go
T
Matthew Meszaros 0e26b9cd00 feat: refine campaign branch scheduling
Evaluate branch conditions relative to the previous send, defer while windows are still undecided, and let the routed pair finder handle deleted targets and loops at schedule time.
2026-06-05 09:10:57 +02:00

29 lines
1.2 KiB
Go

package sequence
import (
"context"
"github.com/warmbly/warmbly/internal/errx"
"github.com/warmbly/warmbly/internal/models"
)
func (s *sequenceService) Create(ctx context.Context, userID, campaignID string) (*models.Sequence, *errx.Error) {
return s.sequenceRepository.Create(ctx, userID, campaignID)
}
func (s *sequenceService) Get(ctx context.Context, userID, campaignID string) ([]models.Sequence, *errx.Error) {
return s.sequenceRepository.Get(ctx, userID, campaignID)
}
func (s *sequenceService) Update(ctx context.Context, userID, campaignID, sequenceID string, data *models.UpdateSequence) (*models.Sequence, *errx.Error) {
// Branch routing is resolved (and made safe against deleted/dangling targets
// and loops) at schedule time in the repository's finder; the repository also
// validates branch shape before persisting. No cross-step write validation is
// needed here — the canvas only ever points a branch at a real step or stop.
return s.sequenceRepository.Update(ctx, userID, campaignID, sequenceID, data)
}
func (s *sequenceService) Delete(ctx context.Context, userID, campaignID, sequenceID string) *errx.Error {
return s.sequenceRepository.Delete(ctx, userID, campaignID, sequenceID)
}