package entity

const CollectionName = "threads_accounts"

type Status string

const (
	StatusOpen    Status = "open"
	StatusDeleted Status = "deleted"
)

const (
	KnownAccountStatusExcluded = "excluded"
)

// KnownAccountProfile stores cross-mission memory for a discovered username
// (Phase 4). Keyed by lowercase username inside Account.KnownAccounts.
type KnownAccountProfile struct {
	FirstSeenAt   int64    `bson:"first_seen_at" json:"first_seen_at"`
	LastSeenAt    int64    `bson:"last_seen_at" json:"last_seen_at"`
	Missions      []string `bson:"missions,omitempty" json:"missions,omitempty"`
	PersonaIds    []string `bson:"persona_ids,omitempty" json:"persona_ids,omitempty"`
	Tags          []string `bson:"tags,omitempty" json:"tags,omitempty"`
	AvgEngagement float64  `bson:"avg_engagement,omitempty" json:"avg_engagement,omitempty"`
	SeenCount     int      `bson:"seen_count,omitempty" json:"seen_count,omitempty"`
	Status        string   `bson:"status,omitempty" json:"status,omitempty"`
}

type Account struct {
	ID            string                         `bson:"_id"`
	TenantID      string                         `bson:"tenant_id"`
	OwnerUID      string                         `bson:"owner_uid"`
	DisplayName   string                         `bson:"display_name,omitempty"`
	Username      string                         `bson:"username,omitempty"`
	ThreadsUserID string                         `bson:"threads_user_id,omitempty"`
	PersonaID     string                         `bson:"persona_id,omitempty"`
	KnownAccounts map[string]KnownAccountProfile `bson:"known_accounts,omitempty" json:"known_accounts,omitempty"`
	Status        Status                         `bson:"status"`
	CreateAt      int64                          `bson:"create_at"`
	UpdateAt      int64                          `bson:"update_at"`
}
