ticketstatus

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Ticket status service errors describe invalid or conflicting status operations.
	ErrUnavailable             = errors.New("ticket status service unavailable")
	ErrProjectNotFound         = domain.ErrProjectNotFound
	ErrStatusNotFound          = domain.ErrStatusNotFound
	ErrDuplicateStatusName     = domain.ErrDuplicateStatusName
	ErrDefaultStatusRequired   = domain.ErrDefaultStatusRequired
	ErrDefaultStatusStage      = domain.ErrDefaultStatusStage
	ErrCannotDeleteLastStatus  = domain.ErrCannotDeleteLastStatus
	ErrReplacementStatusAbsent = domain.ErrReplacementStatusAbsent
)

Functions

func DefaultTemplateNames

func DefaultTemplateNames() []string

DefaultTemplateNames returns the built-in default status names in display order.

Types

type CreateInput

type CreateInput = domain.CreateInput

CreateInput carries the fields required to create a ticket status.

type DeleteResult

type DeleteResult = domain.DeleteResult

DeleteResult reports which status was deleted and which status replaced it.

type ListResult

type ListResult = domain.ListResult

ListResult is the ordered ticket status board payload.

type Optional

type Optional[T any] = domain.Optional[T]

Optional captures whether a value was provided for a partial update.

func Some

func Some[T any](value T) Optional[T]

Some marks an optional value as explicitly set.

type Repository

type Repository interface {
	List(ctx context.Context, projectID uuid.UUID) ([]domain.Status, error)
	ResolveStatusIDByName(ctx context.Context, projectID uuid.UUID, name string) (uuid.UUID, error)
	Get(ctx context.Context, statusID uuid.UUID) (domain.Status, error)
	Create(ctx context.Context, input domain.CreateInput) (domain.Status, error)
	Update(ctx context.Context, input domain.UpdateInput) (domain.Status, error)
	Delete(ctx context.Context, statusID uuid.UUID) (domain.DeleteResult, error)
	ResetToDefaultTemplate(ctx context.Context, projectID uuid.UUID, template []domain.TemplateStatus) ([]domain.Status, error)
	ListProjectStatusRuntimeSnapshots(ctx context.Context, projectID uuid.UUID) ([]domain.StatusRuntimeSnapshot, error)
	ListStatusRuntimeSnapshots(ctx context.Context) ([]domain.StatusRuntimeSnapshot, error)
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides project ticket status management.

func NewService

func NewService(repo Repository) *Service

NewService constructs a ticket status service backed by the provided repository.

func (*Service) Create

func (s *Service) Create(ctx context.Context, input CreateInput) (Status, error)

Create persists a new ticket status in a project.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, statusID uuid.UUID) (DeleteResult, error)

Delete removes a ticket status and reassigns affected tickets when required.

func (*Service) Get

func (s *Service) Get(ctx context.Context, statusID uuid.UUID) (Status, error)

func (*Service) List

func (s *Service) List(ctx context.Context, projectID uuid.UUID) (ListResult, error)

List returns the ordered statuses for a project.

func (*Service) ResetToDefaultTemplate

func (s *Service) ResetToDefaultTemplate(ctx context.Context, projectID uuid.UUID) ([]Status, error)

ResetToDefaultTemplate replaces project statuses with the built-in default template.

func (*Service) ResolveStatusIDByName

func (s *Service) ResolveStatusIDByName(ctx context.Context, projectID uuid.UUID, name string) (uuid.UUID, error)

ResolveStatusIDByName finds a project status by display name.

func (*Service) Update

func (s *Service) Update(ctx context.Context, input UpdateInput) (Status, error)

Update applies a partial update to an existing ticket status.

type Status

type Status = domain.Status

Status is the API-facing ticket status model.

type StatusRuntimeSnapshot

type StatusRuntimeSnapshot = domain.StatusRuntimeSnapshot

StatusRuntimeSnapshot describes the live active-run occupancy for a ticket status.

func ListProjectStatusRuntimeSnapshots

func ListProjectStatusRuntimeSnapshots(ctx context.Context, repo Repository, projectID uuid.UUID) ([]StatusRuntimeSnapshot, error)

ListProjectStatusRuntimeSnapshots returns ordered runtime occupancy for all statuses in a project.

func ListStatusRuntimeSnapshots

func ListStatusRuntimeSnapshots(ctx context.Context, repo Repository) ([]StatusRuntimeSnapshot, error)

ListStatusRuntimeSnapshots returns ordered runtime occupancy for all statuses across projects.

type UpdateInput

type UpdateInput = domain.UpdateInput

UpdateInput carries a partial ticket status update request.

Jump to

Keyboard shortcuts

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