package models import "clapclap/internal/uuid" // Comment supports nested (threaded) replies. type Comment struct { Base Content string `gorm:"type:text;not null" json:"content"` // Relationships AuthorID uuid.UUID `gorm:"type:uuid;index;not null" json:"author_id"` Author *User `gorm:"foreignKey:AuthorID" json:"author"` TrackID uuid.UUID `gorm:"type:uuid;index;not null" json:"track_id"` Track *Track `gorm:"foreignKey:TrackID" json:"track"` // Self-referencing replies ReplyToID *uuid.UUID `gorm:"type:uuid" json:"reply_to_id,omitempty"` Replies []Comment `gorm:"foreignKey:ReplyToID" json:"replies,omitempty"` }