package entity

const CollectionName = "publish_queue"

const (
	StatusScheduled  = "scheduled"
	StatusPublishing = "publishing"
	StatusPublished  = "published"
	StatusFailed     = "failed"
	StatusCancelled  = "cancelled"
	StatusMissed     = "missed"
)

type QueueItem struct {
	ID            string `bson:"_id"`
	TenantID      string `bson:"tenant_id"`
	OwnerUID      string `bson:"owner_uid"`
	AccountID     string `bson:"account_id"`
	PersonaID     string `bson:"persona_id,omitempty"`
	CopyMissionID string `bson:"copy_mission_id,omitempty"`
	CopyDraftID   string `bson:"copy_draft_id,omitempty"`
	Text          string `bson:"text"`
	TopicTag      string `bson:"topic_tag,omitempty"`
	ScheduledAt   int64  `bson:"scheduled_at"`
	Status        string `bson:"status"`
	MediaID       string `bson:"media_id,omitempty"`
	Permalink     string `bson:"permalink,omitempty"`
	PublishedAt   int64  `bson:"published_at,omitempty"`
	ErrorMessage  string `bson:"error_message,omitempty"`
	RetryCount    int    `bson:"retry_count,omitempty"`
	LastAttemptAt int64  `bson:"last_attempt_at,omitempty"`
	NextAttemptAt int64  `bson:"next_attempt_at,omitempty"`
	MissedAt      int64  `bson:"missed_at,omitempty"`
	PausedReason  string `bson:"paused_reason,omitempty"`
	CreateAt      int64  `bson:"create_at"`
	UpdateAt      int64  `bson:"update_at"`
}
