package jobs

import "time"

type Status string

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

// Job represents a unit of work tracked by the system.
type Job struct {
	JobID      string            `json:"job_id"`
	RunID      string            `json:"run_id"`
	NodeID     string            `json:"node_id"`
	Adapter    string            `json:"adapter"`
	Target     string            `json:"target"`
	Status     Status            `json:"status"`
	CreatedAt  time.Time         `json:"created_at"`
	StartedAt  *time.Time        `json:"started_at,omitempty"`
	FinishedAt *time.Time        `json:"finished_at,omitempty"`
	Error      string            `json:"error,omitempty"`
	Metadata   map[string]string `json:"metadata,omitempty"`
}
