<?php

declare(strict_types=1);

namespace Drupal\flowdrop_interrupt\Event;

use Drupal\flowdrop_interrupt\Entity\FlowDropInterruptInterface;
use Symfony\Contracts\EventDispatcher\Event;

/**
 * Event dispatched when an interrupt is created.
 *
 * @internal This class is not part of the public API and may change without notice.
 */
class InterruptCreatedEvent extends Event {

  /**
   * The event name.
   */
  const NAME = 'flowdrop_interrupt.created';

  /**
   * Constructs a new InterruptCreatedEvent.
   *
   * @param \Drupal\flowdrop_interrupt\Entity\FlowDropInterruptInterface $interrupt
   *   The created interrupt entity.
   * @param string $type
   *   The interrupt type value.
   * @param string $workflowId
   *   The workflow ID.
   * @param string $nodeId
   *   The node ID.
   * @param int|null $sessionId
   *   The session ID, if applicable.
   * @param string|null $pipelineId
   *   The pipeline ID, if applicable.
   */
  public function __construct(
    public readonly FlowDropInterruptInterface $interrupt,
    public readonly string $type,
    public readonly string $workflowId,
    public readonly string $nodeId,
    public readonly ?int $sessionId,
    public readonly ?string $pipelineId,
  ) {}

}
