package models

import "time"

// Keep unpin tombstones so older history cannot revive a removed pin.
type PinnedMessage struct {
	ID          uint       `gorm:"primaryKey" json:"id"`
	AgentID     uint       `gorm:"not null;uniqueIndex:idx_pinned_message,priority:1" json:"agent_id"`
	Sender      string     `gorm:"size:64;not null;uniqueIndex:idx_pinned_message,priority:2" json:"sender"`
	MessageID   string     `gorm:"size:128;not null;uniqueIndex:idx_pinned_message,priority:3" json:"message_id"`
	Pinned      bool       `gorm:"not null" json:"pinned"`
	ChangedAtMS int64      `gorm:"not null" json:"-"`
	PinnedAt    time.Time  `json:"pinned_at"`
	ExpiresAt   *time.Time `json:"expires_at"`
	CreatedAt   time.Time  `json:"-"`
	UpdatedAt   time.Time  `json:"-"`
}
