<?php

declare(strict_types=1);

namespace App\Domain\Jobs;

/**
 * What a Job returns after a successful run. Failures throw instead.
 *
 * `details` is freeform per-job data the runner persists into
 * `job_runs.error_message` only on failure; on success it's dropped after
 * being included in the HTTP response envelope (debug-friendly, never
 * security-sensitive).
 */
final class JobResult
{
    /**
     * @param array<string, mixed> $details
     */
    public function __construct(
        public readonly int $itemsProcessed,
        public readonly array $details = [],
    ) {
    }
}
