projectupdate

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnavailable     = errors.New("project update service unavailable")
	ErrProjectNotFound = errors.New("project not found")
	ErrThreadNotFound  = errors.New("project update thread not found")
	ErrCommentNotFound = errors.New("project update comment not found")
)

Functions

This section is empty.

Types

type AddCommentInput

type AddCommentInput struct {
	ProjectID uuid.UUID
	ThreadID  uuid.UUID
	Body      string
	CreatedBy string
}

type AddThreadInput

type AddThreadInput struct {
	ProjectID uuid.UUID
	Status    Status
	Title     string
	Body      string
	CreatedBy string
}

type Comment

type Comment struct {
	ID           uuid.UUID  `json:"id"`
	ThreadID     uuid.UUID  `json:"thread_id"`
	BodyMarkdown string     `json:"body_markdown"`
	CreatedBy    string     `json:"created_by"`
	CreatedAt    time.Time  `json:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at"`
	EditedAt     *time.Time `json:"edited_at,omitempty"`
	EditCount    int        `json:"edit_count"`
	LastEditedBy *string    `json:"last_edited_by,omitempty"`
	IsDeleted    bool       `json:"is_deleted"`
	DeletedAt    *time.Time `json:"deleted_at,omitempty"`
	DeletedBy    *string    `json:"deleted_by,omitempty"`
}

type CommentRevision

type CommentRevision struct {
	ID             uuid.UUID `json:"id"`
	CommentID      uuid.UUID `json:"comment_id"`
	RevisionNumber int       `json:"revision_number"`
	BodyMarkdown   string    `json:"body_markdown"`
	EditedBy       string    `json:"edited_by"`
	EditedAt       time.Time `json:"edited_at"`
	EditReason     *string   `json:"edit_reason,omitempty"`
}

type DeleteCommentResult

type DeleteCommentResult struct {
	DeletedCommentID uuid.UUID `json:"deleted_comment_id"`
}

type DeleteThreadResult

type DeleteThreadResult struct {
	DeletedThreadID uuid.UUID `json:"deleted_thread_id"`
}

type Service

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

func NewService

func NewService(client *entdb.Client, activityEmitter *activity.Emitter) *Service

func (*Service) AddComment

func (s *Service) AddComment(ctx context.Context, input AddCommentInput) (Comment, error)

func (*Service) AddThread

func (s *Service) AddThread(ctx context.Context, input AddThreadInput) (Thread, error)

func (*Service) ListCommentRevisions

func (s *Service) ListCommentRevisions(ctx context.Context, projectID, threadID, commentID uuid.UUID) ([]CommentRevision, error)

func (*Service) ListThreadPage added in v0.3.0

func (s *Service) ListThreadPage(
	ctx context.Context,
	input projectupdatedomain.ListThreadsPage,
) (ThreadPage, error)

func (*Service) ListThreadRevisions

func (s *Service) ListThreadRevisions(ctx context.Context, projectID, threadID uuid.UUID) ([]ThreadRevision, error)

func (*Service) ListThreads

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

func (*Service) RemoveComment

func (s *Service) RemoveComment(ctx context.Context, projectID, threadID, commentID uuid.UUID) (DeleteCommentResult, error)

func (*Service) RemoveThread

func (s *Service) RemoveThread(ctx context.Context, projectID, threadID uuid.UUID) (DeleteThreadResult, error)

func (*Service) UpdateComment

func (s *Service) UpdateComment(ctx context.Context, input UpdateCommentInput) (Comment, error)

func (*Service) UpdateThread

func (s *Service) UpdateThread(ctx context.Context, input UpdateThreadInput) (Thread, error)

type Status

type Status string
const (
	StatusOnTrack  Status = "on_track"
	StatusAtRisk   Status = "at_risk"
	StatusOffTrack Status = "off_track"
)

type Thread

type Thread struct {
	ID             uuid.UUID  `json:"id"`
	ProjectID      uuid.UUID  `json:"project_id"`
	Status         Status     `json:"status"`
	Title          string     `json:"title"`
	BodyMarkdown   string     `json:"body_markdown"`
	CreatedBy      string     `json:"created_by"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
	EditedAt       *time.Time `json:"edited_at,omitempty"`
	EditCount      int        `json:"edit_count"`
	LastEditedBy   *string    `json:"last_edited_by,omitempty"`
	IsDeleted      bool       `json:"is_deleted"`
	DeletedAt      *time.Time `json:"deleted_at,omitempty"`
	DeletedBy      *string    `json:"deleted_by,omitempty"`
	LastActivityAt time.Time  `json:"last_activity_at"`
	CommentCount   int        `json:"comment_count"`
	Comments       []Comment  `json:"comments"`
}

type ThreadPage added in v0.3.0

type ThreadPage struct {
	Threads    []Thread `json:"threads"`
	NextCursor string   `json:"next_cursor,omitempty"`
	HasMore    bool     `json:"has_more"`
}

type ThreadRevision

type ThreadRevision struct {
	ID             uuid.UUID `json:"id"`
	ThreadID       uuid.UUID `json:"thread_id"`
	RevisionNumber int       `json:"revision_number"`
	Status         Status    `json:"status"`
	Title          string    `json:"title"`
	BodyMarkdown   string    `json:"body_markdown"`
	EditedBy       string    `json:"edited_by"`
	EditedAt       time.Time `json:"edited_at"`
	EditReason     *string   `json:"edit_reason,omitempty"`
}

type UpdateCommentInput

type UpdateCommentInput struct {
	ProjectID  uuid.UUID
	ThreadID   uuid.UUID
	CommentID  uuid.UUID
	Body       string
	EditedBy   string
	EditReason string
}

type UpdateThreadInput

type UpdateThreadInput struct {
	ProjectID  uuid.UUID
	ThreadID   uuid.UUID
	Status     Status
	Title      string
	Body       string
	EditedBy   string
	EditReason string
}

Jump to

Keyboard shortcuts

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