package models import ( "time" "github.com/google/uuid" ) // UserPresence represents a user's online status (v0.301 Lot P1, v0.302 P2) type UserPresence struct { UserID uuid.UUID `gorm:"type:uuid;primaryKey" json:"user_id"` Status string `gorm:"type:varchar(20);not null;default:'offline'" json:"status"` // online, away, busy, offline LastSeenAt time.Time `gorm:"not null" json:"last_seen_at"` StatusMsg string `gorm:"type:text" json:"status_message,omitempty"` TrackID *uuid.UUID `gorm:"type:uuid" json:"track_id,omitempty"` TrackTitle string `gorm:"type:text" json:"track_title,omitempty"` Invisible bool `gorm:"not null;default:false" json:"invisible"` UpdatedAt time.Time `gorm:"not null" json:"updated_at"` } // TableName overrides the table name func (UserPresence) TableName() string { return "user_presence" }