package models
import "theskyscape.com/repo/skykit"
// Comment represents a comment on a task
type Comment struct {
skykit.Model
TaskID string
Content string
Author string // For now, just a name string (no auth yet)
}
// CreateComment creates a new comment
func CreateComment(taskID, content, author string) (*Comment, error) {
return Comments.Insert(&Comment{
TaskID: taskID,
Content: content,
Author: author,
})
}
// GetCommentsByTaskID retrieves all comments for a task
func GetCommentsByTaskID(taskID string) ([]*Comment, error) {
return Comments.Search(`
WHERE TaskID = ?
ORDER BY CreatedAt ASC
`, taskID)
}