diff options
Diffstat (limited to 'entities/bug/timeline.go')
-rw-r--r-- | entities/bug/timeline.go | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/entities/bug/timeline.go b/entities/bug/timeline.go index d7f042db..84ece262 100644 --- a/entities/bug/timeline.go +++ b/entities/bug/timeline.go @@ -10,8 +10,8 @@ import ( ) type TimelineItem interface { - // Id return the identifier of the item - Id() entity.Id + // CombinedId returns the global identifier of the item + CombinedId() entity.CombinedId } // CommentHistoryStep hold one version of a message in the history @@ -26,46 +26,46 @@ type CommentHistoryStep struct { // CommentTimelineItem is a TimelineItem that holds a Comment and its edition history type CommentTimelineItem struct { - // id should be the same as in Comment - id entity.Id - Author identity.Interface - Message string - Files []repository.Hash - CreatedAt timestamp.Timestamp - LastEdit timestamp.Timestamp - History []CommentHistoryStep + combinedId entity.CombinedId + Author identity.Interface + Message string + Files []repository.Hash + CreatedAt timestamp.Timestamp + LastEdit timestamp.Timestamp + History []CommentHistoryStep } func NewCommentTimelineItem(comment Comment) CommentTimelineItem { return CommentTimelineItem{ - id: comment.id, - Author: comment.Author, - Message: comment.Message, - Files: comment.Files, - CreatedAt: comment.UnixTime, - LastEdit: comment.UnixTime, + // id: comment.id, + combinedId: comment.combinedId, + Author: comment.Author, + Message: comment.Message, + Files: comment.Files, + CreatedAt: comment.unixTime, + LastEdit: comment.unixTime, History: []CommentHistoryStep{ { Message: comment.Message, - UnixTime: comment.UnixTime, + UnixTime: comment.unixTime, }, }, } } -func (c *CommentTimelineItem) Id() entity.Id { - return c.id +func (c *CommentTimelineItem) CombinedId() entity.CombinedId { + return c.combinedId } // Append will append a new comment in the history and update the other values func (c *CommentTimelineItem) Append(comment Comment) { c.Message = comment.Message c.Files = comment.Files - c.LastEdit = comment.UnixTime + c.LastEdit = comment.unixTime c.History = append(c.History, CommentHistoryStep{ Author: comment.Author, Message: comment.Message, - UnixTime: comment.UnixTime, + UnixTime: comment.unixTime, }) } |