Documentation
¶
Overview ¶
Package service contains the business logic layer. It orchestrates validation, audit recording, and transactional operations by calling the repo interfaces. The service layer is storage-agnostic.
Index ¶
- func New(store repo.Store, opts ...Option) taskflow.TaskFlow
- type Option
- type Service
- func (s *Service) BoardDetail(ctx context.Context, slug string) (model.BoardDetail, error)
- func (s *Service) BoardOverview(ctx context.Context, slug string) (model.BoardOverview, error)
- func (s *Service) CheckWorkflowHealth(ctx context.Context, boardSlug string) ([]workflow.HealthIssue, error)
- func (s *Service) CreateActor(ctx context.Context, params model.CreateActorParams) (model.Actor, error)
- func (s *Service) CreateAttachment(ctx context.Context, params model.CreateAttachmentParams) (model.Attachment, error)
- func (s *Service) CreateBoard(ctx context.Context, params model.CreateBoardParams) (model.Board, error)
- func (s *Service) CreateComment(ctx context.Context, params model.CreateCommentParams) (model.Comment, error)
- func (s *Service) CreateDependency(ctx context.Context, params model.CreateDependencyParams) (model.Dependency, error)
- func (s *Service) CreateTask(ctx context.Context, params model.CreateTaskParams) (model.Task, error)
- func (s *Service) CreateWebhook(ctx context.Context, params model.CreateWebhookParams) (model.Webhook, error)
- func (s *Service) DeleteAttachment(ctx context.Context, id int, actor string) error
- func (s *Service) DeleteBoard(ctx context.Context, slug, actor string) error
- func (s *Service) DeleteDependency(ctx context.Context, id int, actor string) error
- func (s *Service) DeleteTask(ctx context.Context, boardSlug string, num int, actor string) error
- func (s *Service) DeleteWebhook(ctx context.Context, id int) error
- func (s *Service) GetActor(ctx context.Context, name string) (model.Actor, error)
- func (s *Service) GetActorByAPIKeyHash(ctx context.Context, hash string) (model.Actor, error)
- func (s *Service) GetBoard(ctx context.Context, slug string) (model.Board, error)
- func (s *Service) GetTask(ctx context.Context, boardSlug string, num int) (model.Task, error)
- func (s *Service) GetWebhook(ctx context.Context, id int) (model.Webhook, error)
- func (s *Service) GetWorkflow(ctx context.Context, boardSlug string) (*workflow.Workflow, error)
- func (s *Service) ListActors(ctx context.Context) ([]model.Actor, error)
- func (s *Service) ListAttachments(ctx context.Context, boardSlug string, taskNum int) ([]model.Attachment, error)
- func (s *Service) ListBoards(ctx context.Context, params model.ListBoardsParams) ([]model.Board, error)
- func (s *Service) ListComments(ctx context.Context, boardSlug string, taskNum int) ([]model.Comment, error)
- func (s *Service) ListDependencies(ctx context.Context, boardSlug string, taskNum int) ([]model.Dependency, error)
- func (s *Service) ListTags(ctx context.Context, boardSlug string) ([]model.TagCount, error)
- func (s *Service) ListTasks(ctx context.Context, filter model.TaskFilter, sort *model.TaskSort) ([]model.Task, error)
- func (s *Service) ListWebhookDeliveries(ctx context.Context, webhookID int) ([]model.WebhookDelivery, error)
- func (s *Service) ListWebhooks(ctx context.Context) ([]model.Webhook, error)
- func (s *Service) QueryAuditByBoard(ctx context.Context, boardSlug string) ([]model.AuditEntry, error)
- func (s *Service) QueryAuditByTask(ctx context.Context, boardSlug string, taskNum int) ([]model.AuditEntry, error)
- func (s *Service) ReassignTasks(ctx context.Context, fromSlug, toSlug, actor string, states []string) (int, error)
- func (s *Service) RotateActorKey(ctx context.Context, name string) (string, error)
- func (s *Service) SearchTasks(ctx context.Context, filter model.TaskFilter) ([]model.Task, error)
- func (s *Service) SetWorkflow(ctx context.Context, boardSlug string, workflowJSON json.RawMessage, ...) error
- func (s *Service) SystemStats(ctx context.Context) (model.SystemStats, error)
- func (s *Service) TaskDetail(ctx context.Context, boardSlug string, num int) (model.TaskDetail, error)
- func (s *Service) TransitionTask(ctx context.Context, params model.TransitionTaskParams) (model.Task, error)
- func (s *Service) UpdateActor(ctx context.Context, params model.UpdateActorParams) (model.Actor, error)
- func (s *Service) UpdateBoard(ctx context.Context, params model.UpdateBoardParams) (model.Board, error)
- func (s *Service) UpdateComment(ctx context.Context, params model.UpdateCommentParams, actor string) (model.Comment, error)
- func (s *Service) UpdateTask(ctx context.Context, params model.UpdateTaskParams, actor string) (model.Task, error)
- func (s *Service) UpdateWebhook(ctx context.Context, params model.UpdateWebhookParams) (model.Webhook, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*Service)
Option configures the Service.
func WithEventBus ¶
WithEventBus injects an event bus. If not provided, events are silently discarded.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) BoardDetail ¶
BoardDetail returns a complete board snapshot with all tasks and their nested comments, attachments, dependencies, and audit entries.
func (*Service) BoardOverview ¶
BoardOverview returns board metadata with task counts by state.
func (*Service) CheckWorkflowHealth ¶
func (*Service) CreateActor ¶
func (*Service) CreateAttachment ¶
func (s *Service) CreateAttachment(ctx context.Context, params model.CreateAttachmentParams) (model.Attachment, error)
func (*Service) CreateBoard ¶
func (*Service) CreateComment ¶
func (*Service) CreateDependency ¶
func (s *Service) CreateDependency(ctx context.Context, params model.CreateDependencyParams) (model.Dependency, error)
func (*Service) CreateTask ¶
func (*Service) CreateWebhook ¶
func (*Service) DeleteAttachment ¶
func (*Service) DeleteBoard ¶
func (*Service) DeleteDependency ¶
func (*Service) DeleteTask ¶
func (*Service) GetActorByAPIKeyHash ¶
func (*Service) GetWebhook ¶
func (*Service) GetWorkflow ¶
func (*Service) ListActors ¶
func (*Service) ListAttachments ¶
func (*Service) ListBoards ¶
func (*Service) ListComments ¶
func (*Service) ListDependencies ¶
func (*Service) ListWebhookDeliveries ¶
func (*Service) ListWebhooks ¶
func (*Service) QueryAuditByBoard ¶
func (*Service) QueryAuditByTask ¶
func (*Service) ReassignTasks ¶
func (*Service) RotateActorKey ¶
RotateActorKey generates a new API key for the actor, stores the hash, and returns the plaintext key (shown once).
func (*Service) SearchTasks ¶
SearchTasks lists tasks across all boards, applying the given filter.
func (*Service) SetWorkflow ¶
func (*Service) SystemStats ¶
SystemStats returns system-wide statistics across all actors, boards, tasks, and audit activity.
func (*Service) TaskDetail ¶
func (s *Service) TaskDetail(ctx context.Context, boardSlug string, num int) (model.TaskDetail, error)
TaskDetail returns a task with its comments, attachments, dependencies, and audit.