32 lines
1.3 KiB
Go
32 lines
1.3 KiB
Go
package store
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.gobha.me/xcaliber/chat-switchboard/models"
|
|
)
|
|
|
|
// WorkflowStore manages workflow definitions, stages, and version snapshots.
|
|
type WorkflowStore interface {
|
|
// Workflow CRUD
|
|
Create(ctx context.Context, w *models.Workflow) error
|
|
GetByID(ctx context.Context, id string) (*models.Workflow, error)
|
|
GetBySlug(ctx context.Context, teamID *string, slug string) (*models.Workflow, error)
|
|
Update(ctx context.Context, id string, patch models.WorkflowPatch) error
|
|
Delete(ctx context.Context, id string) error
|
|
ListForTeam(ctx context.Context, teamID string) ([]models.Workflow, error)
|
|
ListGlobal(ctx context.Context) ([]models.Workflow, error)
|
|
|
|
// Stage CRUD
|
|
CreateStage(ctx context.Context, s *models.WorkflowStage) error
|
|
ListStages(ctx context.Context, workflowID string) ([]models.WorkflowStage, error)
|
|
UpdateStage(ctx context.Context, s *models.WorkflowStage) error
|
|
DeleteStage(ctx context.Context, id string) error
|
|
ReorderStages(ctx context.Context, workflowID string, orderedIDs []string) error
|
|
|
|
// Versioning
|
|
Publish(ctx context.Context, v *models.WorkflowVersion) error
|
|
GetVersion(ctx context.Context, workflowID string, versionNumber int) (*models.WorkflowVersion, error)
|
|
GetLatestVersion(ctx context.Context, workflowID string) (*models.WorkflowVersion, error)
|
|
}
|