package models import "time" // A Chapter is a part of a story. type Chapter struct { ID string `bson:"_id"` StoryID string `bson:"storyId"` Title string `bson:"title"` Author string `bson:"author"` Source string `bson:"source"` CreatedDate time.Time `bson:"createdDate"` FictionalDate time.Time `bson:"fictionalDate,omitempty"` EditedDate time.Time `bson:"editedDate"` CommentMode ChapterCommentMode `bson:"commentMode"` CommentsLocked bool `bson:"commentsLocked"` } // CanComment returns true if the chapter can be commented to. func (chapter *Chapter) CanComment() bool { return !chapter.CommentsLocked && chapter.CommentMode.IsEnabled() }