<?php

declare(strict_types=1);

namespace Drupal\flowdrop_runtime\Event;

use Symfony\Contracts\EventDispatcher\Event;

/**
 * Event dispatched when a batch of execution errors occurs.
 *
 * @internal
 */
class BatchExecutionErrorEvent extends Event {

  /**
   * The event name.
   */
  const NAME = 'flowdrop_runtime.execution.batch_error';

  /**
   * Constructs a new BatchExecutionErrorEvent.
   *
   * @param array $errors
   *   The array of errors.
   * @param array $results
   *   The error handling results.
   * @param int $criticalErrorsCount
   *   The number of critical errors.
   * @param array $context
   *   Additional context.
   * @param int $timestamp
   *   The event timestamp.
   */
  public function __construct(
    public readonly array $errors,
    public readonly array $results,
    public readonly int $criticalErrorsCount,
    public readonly array $context,
    public readonly int $timestamp,
  ) {}

}
