<?php

declare(strict_types=1);

namespace Drupal\flowdrop_workflow\Event;

use Drupal\flowdrop_workflow\FlowDropWorkflowInterface;
use Symfony\Contracts\EventDispatcher\Event;

/**
 * Dispatched after a workflow is duplicated via the duplicate form.
 *
 * Duplicating copies the graph (nodes, edges, ports) via createDuplicate() but
 * not the satellite config entities that other modules bind to a workflow by
 * ID.
 * Subscribers use this event to propagate those satellites from the source
 * workflow to the new copy (e.g. flowdrop_trigger clones its trigger configs).
 *
 * @internal This class is not part of the public API and may change without notice.
 */
final class WorkflowDuplicatedEvent extends Event {

  public function __construct(
    public readonly string $sourceWorkflowId,
    public readonly FlowDropWorkflowInterface $newWorkflow,
  ) {}

}
