<?php

declare(strict_types=1);

namespace Drupal\flowdrop_stategraph\Event;

use Drupal\flowdrop_stategraph\DTO\Checkpoint;
use Symfony\Contracts\EventDispatcher\Event;

/**
 * Event dispatched when an approval gate request is rejected.
 *
 * @internal This class is not part of the public API and may change without notice.
 */
class ApprovalGateRejectedEvent extends Event {

  /**
   * The event name.
   */
  const NAME = 'flowdrop_stategraph.approval_rejected';

  /**
   * Constructs a new ApprovalGateRejectedEvent.
   *
   * @param \Drupal\flowdrop_stategraph\DTO\Checkpoint $checkpoint
   *   The checkpoint associated with the approval gate.
   * @param string $requestId
   *   The approval request ID.
   * @param int|null $userId
   *   The user ID who rejected.
   * @param string $reason
   *   The rejection reason.
   */
  public function __construct(
    public readonly Checkpoint $checkpoint,
    public readonly string $requestId,
    public readonly ?int $userId,
    public readonly string $reason,
  ) {}

}
