incident

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAffectedComponentsPayload   = errors.New("invalid affected components payload")
	ErrInvalidAffectedComponentsReference = errors.New("one or more affected components or subcomponents are invalid")
)

Functions

This section is empty.

Types

type AffectedComponentInput

type AffectedComponentInput struct {
	ComponentID     string
	SubComponentIDs []string
}

type CreateInput

type CreateInput struct {
	RequestBody
	CreatorIDHex    string
	CreatorUsername string
}

type RequestBody

type RequestBody struct {
	Title                    string
	Description              string
	DescriptionJSON          models.RichTextDocument
	VisibilityState          models.IncidentVisibilityState
	Status                   models.IncidentStatus
	Impact                   models.IncidentImpact
	AffectedComponents       []string
	Components               []string
	AffectedComponentTargets []AffectedComponentInput
	AffectedComponentsNew    []AffectedComponentInput
}

type Service

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

func NewService

func NewService(repo repository.IncidentRepository) *Service

func (*Service) AddUpdate

func (s *Service) AddUpdate(ctx context.Context, incidentID primitive.ObjectID, message string, status models.IncidentStatus) (models.IncidentUpdate, error)

func (*Service) Create

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

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, incidentID primitive.ObjectID) error

func (*Service) GetByID

func (s *Service) GetByID(ctx context.Context, incidentID primitive.ObjectID) (models.Incident, error)

func (*Service) List

func (s *Service) List(ctx context.Context, statusFilter, startDateRaw, endDateRaw string, page, limit int) ([]models.Incident, int64, error)

func (*Service) ListHistory

func (s *Service) ListHistory(ctx context.Context, incidentID primitive.ObjectID) ([]models.AuditLog, error)

func (*Service) ListUpdates

func (s *Service) ListUpdates(ctx context.Context, incidentID primitive.ObjectID) ([]models.IncidentUpdate, error)

func (*Service) Resolve

func (s *Service) Resolve(ctx context.Context, incidentID primitive.ObjectID) (models.Incident, error)

func (*Service) Update

func (s *Service) Update(ctx context.Context, id primitive.ObjectID, input RequestBody) (models.Incident, error)

Jump to

Keyboard shortcuts

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