veza/veza-backend-api/internal/models/user_presence.go

21 lines
647 B
Go

package models
import (
"time"
"github.com/google/uuid"
)
// UserPresence represents a user's online status (v0.301 Lot P1)
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"`
UpdatedAt time.Time `gorm:"not null" json:"updated_at"`
}
// TableName overrides the table name
func (UserPresence) TableName() string {
return "user_presence"
}