package domain

import "time"

// Session is an opaque server-side session (§4.8). The random token is the
// document id; the Mongo TTL index on expiresAt reaps stale rows.
type Session struct {
	Token       string    `bson:"_id"`
	UserID      string    `bson:"userId"`
	CreatedAt   time.Time `bson:"createdAt"`
	ExpiresAt   time.Time `bson:"expiresAt"`
	RefreshedAt time.Time `bson:"refreshedAt"`
	IP          string    `bson:"ip"`
	UA          string    `bson:"ua"`
}

// SessionTTL is the sliding session lifetime (§7).
const SessionTTL = 30 * 24 * time.Hour
