package entity

import brandentity "haixun-backend/internal/model/brand/domain/entity"

const CollectionName = "placement_topics"

type Status string

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

type Topic struct {
	ID          string                  `bson:"_id"`
	TenantID    string                  `bson:"tenant_id"`
	OwnerUID    string                  `bson:"owner_uid"`
	BrandID     string                  `bson:"brand_id"`
	TopicName   string                  `bson:"topic_name,omitempty"`
	SeedQuery   string                  `bson:"seed_query,omitempty"`
	Brief       string                  `bson:"brief,omitempty"`
	ProductID   string                  `bson:"product_id,omitempty"`
	ResearchMap brandentity.ResearchMap `bson:"research_map,omitempty"`
	Status      Status                  `bson:"status"`
	CreateAt    int64                   `bson:"create_at"`
	UpdateAt    int64                   `bson:"update_at"`
}

func (t Topic) HasPlacementSignals() bool {
	return t.TopicName != "" ||
		t.SeedQuery != "" ||
		t.Brief != "" ||
		!t.ResearchMap.IsEmpty()
}
