<?php

declare(strict_types=1);

namespace Drupal\flowdrop_interrupt\DTO;

use Drupal\flowdrop_interrupt\Enum\InterruptDirection;

/**
 * Orchestrator-stamped execution identity for an interrupt.
 *
 * Carries the routing/authorization fields that the framework owns — never
 * the node. Constructed at the catch site (typically
 * JobInterruptCaughtSubscriber) from the JobInterruptCaughtEvent and handed
 * to the bus alongside an
 * {@see \Drupal\flowdrop_interrupt\Message\InterruptMessageInterface}.
 *
 * Synchronous callers (sentinels, inward signals) construct this directly
 * with whatever identity makes sense — they're not in the catch-site path
 * but use the same bus.
 *
 * @api
 */
final class ExecutionStamp {

  public function __construct(
    public readonly string $workflowId,
    public readonly string $nodeId,
    public readonly ?string $pipelineId = NULL,
    public readonly ?int $sessionId = NULL,
    public readonly ?int $jobId = NULL,
    public readonly InterruptDirection $direction = InterruptDirection::Outward,
  ) {}

}
