<?php

declare(strict_types=1);

namespace Drupal\flowdrop_pipeline\Event;

use Drupal\flowdrop_job\FlowDropJobInterface;
use Symfony\Contracts\EventDispatcher\Event;

/**
 * Event dispatched when a job is created for a pipeline.
 *
 * @internal
 */
class JobCreatedEvent extends Event {

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

  /**
   * Constructs a new JobCreatedEvent.
   *
   * @param \Drupal\flowdrop_job\FlowDropJobInterface $job
   *   The created job entity.
   * @param string|int|null $pipelineId
   *   The pipeline ID.
   * @param string $nodeId
   *   The workflow node ID.
   * @param array $dependencies
   *   The dependency node IDs.
   */
  public function __construct(
    public readonly FlowDropJobInterface $job,
    public readonly string|int|null $pipelineId,
    public readonly string $nodeId,
    public readonly array $dependencies,
  ) {}

}
