package models import "clapclap/internal/uuid" // Track represents a music upload. type Track struct { Base Name string `gorm:"not null" json:"name" binding:"required"` // S3 Links (Stored as string URLs) CoverImage string `gorm:"type:text" json:"cover_image"` AudioFile string `gorm:"not null;type:text;default:'no audio file'" json:"audio_file" binding:"required"` OwnerID uuid.UUID `gorm:"type:uuid;index;not null" json:"owner_id"` Owner *User `gorm:"foreignKey:OwnerID" json:"owner,omitempty"` // Genres & Social GenreID uuid.UUID `gorm:"type:uuid;index" json:"genre_id"` Genre *Genre `gorm:"foreignKey:GenreID" json:"genre"` Comments *[]Comment `gorm:"foreignKey:TrackID" json:"comments,omitempty"` AverageRating float64 `gorm:"default:0" json:"average_rating"` RatingCount int `gorm:"default:0" json:"rating_count"` IsPublic bool `gorm:"not null" json:"is_public"` Ratings *[]Rating `gorm:"foreignKey:TrackID" json:"ratings,omitempty"` }