2026-02-21 04:22:33 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"github.com/google/uuid"
|
|
|
|
|
)
|
|
|
|
|
|
2026-02-21 15:47:09 +00:00
|
|
|
// UserPresence represents a user's online status (v0.301 Lot P1, v0.302 P2)
|
2026-02-21 04:22:33 +00:00
|
|
|
type UserPresence struct {
|
2026-03-05 22:03:43 +00:00
|
|
|
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"`
|
2026-02-21 04:22:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TableName overrides the table name
|
|
|
|
|
func (UserPresence) TableName() string {
|
|
|
|
|
return "user_presence"
|
|
|
|
|
}
|