package jobs

import (
	"context"
	"log/slog"

	"github.com/riverqueue/river"
)

// HeartbeatArgs carries no data — heartbeat is purely a proof-of-life tick.
type HeartbeatArgs struct{}

func (HeartbeatArgs) Kind() string { return "heartbeat" }

// HeartbeatWorker logs a heartbeat message on each execution.
type HeartbeatWorker struct {
	river.WorkerDefaults[HeartbeatArgs]
}

func (w *HeartbeatWorker) Work(ctx context.Context, job *river.Job[HeartbeatArgs]) error {
	slog.Info("worker heartbeat",
		"job_id", job.ID,
		"attempt", job.Attempt,
	)
	return nil
}
