package eventbus

// Named topics. Add a constant here when a new topic is introduced; never
// pass string literals to Subscribe/Publish.

const (
	// TopicTorrents broadcasts per-torrent state changes (added, completed,
	// state transitions, deletions). Payload type: TorrentEvent (defined
	// alongside the publisher in internal/snapshot). Phase 3 introduced
	// this; Phase 4 adds the finer-grained topics below for subscribers
	// that only care about specific transitions.
	TopicTorrents Topic = "torrents"

	// TopicTorrentCompleted fires once when a torrent finishes downloading.
	// Payload: webhooks.QbitEvent with Kind="completed".
	TopicTorrentCompleted Topic = "torrent.completed"

	// TopicTorrentStateChanged fires on any state transition (downloading
	// → uploading, paused → stalled, etc.). Payload: webhooks.QbitEvent.
	TopicTorrentStateChanged Topic = "torrent.state_changed"

	// TopicTrackerStatusChanged fires when a tracker scrape outcome changes
	// classification (ok ↔ auth-failure ↔ structural). Payload: a struct
	// with tracker_id, classification, and message.
	TopicTrackerStatusChanged Topic = "tracker.status_changed"

	// TopicAutobrrGrab fires on every autobrr filter match. Payload:
	// webhooks.AutobrrGrabEvent.
	TopicAutobrrGrab Topic = "autobrr.grab"

	// TopicCrossseedMatchFound fires when cross-seed finds a candidate match.
	TopicCrossseedMatchFound Topic = "crossseed.match_found"

	// TopicCrossseedMatchApplied fires when cross-seed actually injects a
	// matched torrent into a client.
	TopicCrossseedMatchApplied Topic = "crossseed.match_applied"

	// TopicSystemEvents broadcasts non-domain events (boot, config reload,
	// scrape failure escalations). Payload type: any structured map.
	TopicSystemEvents Topic = "system_events"

	// TopicWebhookCustom is the catch-all topic for /webhook/generic/:id
	// payloads. Operator-defined; payload is the raw decoded JSON map.
	TopicWebhookCustom Topic = "webhook.custom"
)
