package models import "clapclap/internal/uuid" type Rating struct { Base // GORM Check constraint ensures DB integrity (1-10) Value int `gorm:"check:value >= 1 AND value <= 10;not null" json:"value"` AuthorID uuid.UUID `gorm:"type:uuid;index:idx_author_track,unique;not null" json:"author_id"` Author *User `gorm:"foreignKey:AuthorID" json:"author"` TrackID uuid.UUID `gorm:"type:uuid;index:idx_author_track,unique;not null" json:"track_id"` Track *Track `gorm:"foreignKey:TrackID" json:"track"` }