mirror of
https://github.com/warmbly/warmbly.git
synced 2026-08-19 08:01:16 +00:00
0e26b9cd00
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.
29 lines
1.2 KiB
Go
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)
|
|
}
|