1package board
 2
 3import (
 4	"github.com/git-bug/git-bug/entities/bug"
 5	"github.com/git-bug/git-bug/entities/common"
 6	"github.com/git-bug/git-bug/entities/identity"
 7	"github.com/git-bug/git-bug/entity"
 8	"github.com/git-bug/git-bug/entity/dag"
 9)
10
11var _ Item = &BugItem{}
12
13type BugItem struct {
14	combinedId entity.CombinedId
15	Bug        dag.CompileTo[*bug.Snapshot]
16}
17
18func (e *BugItem) CombinedId() entity.CombinedId {
19	if e.combinedId == "" || e.combinedId == entity.UnsetCombinedId {
20		// simply panic as it would be a coding error (no id provided at construction)
21		panic("no combined id")
22	}
23	return e.combinedId
24}
25
26func (e *BugItem) Author() identity.Interface {
27	return e.Bug.Snapshot().Author
28}
29
30func (e *BugItem) Title() string {
31	return e.Bug.Snapshot().Title
32}
33
34func (e *BugItem) Labels() []common.Label {
35	return e.Bug.Snapshot().Labels
36}
37
38// IsAuthored is a sign post method for gqlgen
39func (e *BugItem) IsAuthored() {}