service

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(store repo.Store, opts ...Option) taskflow.TaskFlow

New creates a new Service backed by the given store.

Types

type Option

type Option func(*Service)

Option configures the Service.

func WithEventBus

func WithEventBus(bus *eventbus.EventBus) Option

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

func (s *Service) BoardDetail(ctx context.Context, slug string) (model.BoardDetail, error)

BoardDetail returns a complete board snapshot with all tasks and their nested comments, attachments, dependencies, and audit entries.

func (*Service) BoardOverview

func (s *Service) BoardOverview(ctx context.Context, slug string) (model.BoardOverview, error)

BoardOverview returns board metadata with task counts by state.

func (*Service) CheckWorkflowHealth

func (s *Service) CheckWorkflowHealth(ctx context.Context, boardSlug string) ([]workflow.HealthIssue, error)

func (*Service) CreateActor

func (s *Service) CreateActor(ctx context.Context, params model.CreateActorParams) (model.Actor, error)

func (*Service) CreateAttachment

func (s *Service) CreateAttachment(ctx context.Context, params model.CreateAttachmentParams) (model.Attachment, error)

func (*Service) CreateBoard

func (s *Service) CreateBoard(ctx context.Context, params model.CreateBoardParams) (model.Board, error)

func (*Service) CreateComment

func (s *Service) CreateComment(ctx context.Context, params model.CreateCommentParams) (model.Comment, error)

func (*Service) CreateDependency

func (s *Service) CreateDependency(ctx context.Context, params model.CreateDependencyParams) (model.Dependency, error)

func (*Service) CreateTask

func (s *Service) CreateTask(ctx context.Context, params model.CreateTaskParams) (model.Task, error)

func (*Service) CreateWebhook

func (s *Service) CreateWebhook(ctx context.Context, params model.CreateWebhookParams) (model.Webhook, error)

func (*Service) DeleteAttachment

func (s *Service) DeleteAttachment(ctx context.Context, id int, actor string) error

func (*Service) DeleteBoard

func (s *Service) DeleteBoard(ctx context.Context, slug, actor string) error

func (*Service) DeleteDependency

func (s *Service) DeleteDependency(ctx context.Context, id int, actor string) error

func (*Service) DeleteTask

func (s *Service) DeleteTask(ctx context.Context, boardSlug string, num int, actor string) error

func (*Service) DeleteWebhook

func (s *Service) DeleteWebhook(ctx context.Context, id int) error

func (*Service) GetActor

func (s *Service) GetActor(ctx context.Context, name string) (model.Actor, error)

func (*Service) GetActorByAPIKeyHash

func (s *Service) GetActorByAPIKeyHash(ctx context.Context, hash string) (model.Actor, error)

func (*Service) GetBoard

func (s *Service) GetBoard(ctx context.Context, slug string) (model.Board, error)

func (*Service) GetTask

func (s *Service) GetTask(ctx context.Context, boardSlug string, num int) (model.Task, error)

func (*Service) GetWebhook

func (s *Service) GetWebhook(ctx context.Context, id int) (model.Webhook, error)

func (*Service) GetWorkflow

func (s *Service) GetWorkflow(ctx context.Context, boardSlug string) (*workflow.Workflow, error)

func (*Service) ListActors

func (s *Service) ListActors(ctx context.Context) ([]model.Actor, error)

func (*Service) ListAttachments

func (s *Service) ListAttachments(ctx context.Context, boardSlug string, taskNum int) ([]model.Attachment, error)

func (*Service) ListBoards

func (s *Service) ListBoards(ctx context.Context, params model.ListBoardsParams) ([]model.Board, error)

func (*Service) ListComments

func (s *Service) ListComments(ctx context.Context, boardSlug string, taskNum int) ([]model.Comment, error)

func (*Service) ListDependencies

func (s *Service) ListDependencies(ctx context.Context, boardSlug string, taskNum int) ([]model.Dependency, error)

func (*Service) ListTags

func (s *Service) ListTags(ctx context.Context, boardSlug string) ([]model.TagCount, error)

func (*Service) ListTasks

func (s *Service) ListTasks(ctx context.Context, filter model.TaskFilter, sort *model.TaskSort) ([]model.Task, error)

func (*Service) ListWebhookDeliveries

func (s *Service) ListWebhookDeliveries(ctx context.Context, webhookID int) ([]model.WebhookDelivery, error)

func (*Service) ListWebhooks

func (s *Service) ListWebhooks(ctx context.Context) ([]model.Webhook, error)

func (*Service) QueryAuditByBoard

func (s *Service) QueryAuditByBoard(ctx context.Context, boardSlug string) ([]model.AuditEntry, error)

func (*Service) QueryAuditByTask

func (s *Service) QueryAuditByTask(ctx context.Context, boardSlug string, taskNum int) ([]model.AuditEntry, error)

func (*Service) ReassignTasks

func (s *Service) ReassignTasks(ctx context.Context, fromSlug, toSlug, actor string, states []string) (int, error)

func (*Service) RotateActorKey

func (s *Service) RotateActorKey(ctx context.Context, name string) (string, error)

RotateActorKey generates a new API key for the actor, stores the hash, and returns the plaintext key (shown once).

func (*Service) SearchTasks

func (s *Service) SearchTasks(ctx context.Context, filter model.TaskFilter) ([]model.Task, error)

SearchTasks lists tasks across all boards, applying the given filter.

func (*Service) SetWorkflow

func (s *Service) SetWorkflow(ctx context.Context, boardSlug string, workflowJSON json.RawMessage, actor string) error

func (*Service) SystemStats

func (s *Service) SystemStats(ctx context.Context) (model.SystemStats, error)

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.

func (*Service) TransitionTask

func (s *Service) TransitionTask(ctx context.Context, params model.TransitionTaskParams) (model.Task, error)

func (*Service) UpdateActor

func (s *Service) UpdateActor(ctx context.Context, params model.UpdateActorParams) (model.Actor, error)

func (*Service) UpdateBoard

func (s *Service) UpdateBoard(ctx context.Context, params model.UpdateBoardParams) (model.Board, error)

func (*Service) UpdateComment

func (s *Service) UpdateComment(ctx context.Context, params model.UpdateCommentParams, actor string) (model.Comment, error)

func (*Service) UpdateTask

func (s *Service) UpdateTask(ctx context.Context, params model.UpdateTaskParams, actor string) (model.Task, error)

func (*Service) UpdateWebhook

func (s *Service) UpdateWebhook(ctx context.Context, params model.UpdateWebhookParams) (model.Webhook, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL