package jobs

import "encoding/json"

// Kind represents the type of worker job.
type Kind string

const (
	KindImportDailyBars    Kind = "import_daily_bars"
	KindNormalizeDailyBars Kind = "normalize_daily_bars"
	KindRunBacktest        Kind = "run_backtest"
)

// Status represents the state of a job.
type Status string

const (
	StatusPending   Status = "pending"
	StatusRunning   Status = "running"
	StatusCompleted Status = "completed"
	StatusFailed    Status = "failed"
)

// Job represents a background execution unit.
type Job struct {
	ID      string          `json:"id"`
	Kind    Kind            `json:"kind"`
	Status  Status          `json:"status"`
	Payload json.RawMessage `json:"payload,omitempty"`
	Error   string          `json:"error,omitempty"`
}
