<?php

declare(strict_types=1);

namespace Drupal\flowdrop_stategraph\Entity;

use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityChangedInterface;
use Drupal\flowdrop_stategraph\DTO\Checkpoint;
use Drupal\flowdrop_stategraph\DTO\GraphState;
use Drupal\user\EntityOwnerInterface;

/**
 * Interface for FlowDropStateCheckpoint entity.
 *
 * @internal This class is not part of the public API and may change without notice.
 */
interface FlowDropStateCheckpointInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface {

  /**
   * Gets the checkpoint ID.
   *
   * @return string
   *   The checkpoint ID.
   */
  public function getCheckpointId(): string;

  /**
   * Sets the checkpoint ID.
   *
   * @param string $checkpointId
   *   The checkpoint ID.
   *
   * @return static
   *   The entity for chaining.
   */
  public function setCheckpointId(string $checkpointId): static;

  /**
   * Gets the thread ID.
   *
   * @return string
   *   The thread ID.
   */
  public function getThreadId(): string;

  /**
   * Sets the thread ID.
   *
   * @param string $threadId
   *   The thread ID.
   *
   * @return static
   *   The entity for chaining.
   */
  public function setThreadId(string $threadId): static;

  /**
   * Gets the raw state data array.
   *
   * @return array<string, mixed>
   *   The state data.
   */
  public function getStateData(): array;

  /**
   * Sets the raw state data array.
   *
   * @param array<string, mixed> $stateData
   *   The state data.
   *
   * @return static
   *   The entity for chaining.
   */
  public function setStateData(array $stateData): static;

  /**
   * Gets the graph state as a DTO.
   *
   * @return \Drupal\flowdrop_stategraph\DTO\GraphState
   *   The graph state DTO.
   */
  public function getGraphState(): GraphState;

  /**
   * Sets the graph state from a DTO.
   *
   * @param \Drupal\flowdrop_stategraph\DTO\GraphState $state
   *   The graph state DTO.
   *
   * @return static
   *   The entity for chaining.
   */
  public function setGraphState(GraphState $state): static;

  /**
   * Gets the node ID where checkpoint was created.
   *
   * @return string
   *   The node ID.
   */
  public function getNodeId(): string;

  /**
   * Sets the node ID.
   *
   * @param string $nodeId
   *   The node ID.
   *
   * @return static
   *   The entity for chaining.
   */
  public function setNodeId(string $nodeId): static;

  /**
   * Gets the metadata array.
   *
   * @return array<string, mixed>
   *   The metadata.
   */
  public function getMetadata(): array;

  /**
   * Sets the metadata array.
   *
   * @param array<string, mixed> $metadata
   *   The metadata.
   *
   * @return static
   *   The entity for chaining.
   */
  public function setMetadata(array $metadata): static;

  /**
   * Gets the parent checkpoint ID.
   *
   * @return string|null
   *   The parent checkpoint ID or NULL.
   */
  public function getParentCheckpointId(): ?string;

  /**
   * Sets the parent checkpoint ID.
   *
   * @param string|null $parentCheckpointId
   *   The parent checkpoint ID or NULL.
   *
   * @return static
   *   The entity for chaining.
   */
  public function setParentCheckpointId(?string $parentCheckpointId): static;

  /**
   * Gets the created timestamp.
   *
   * @return int
   *   The created timestamp.
   */
  public function getCreatedTime(): int;

  /**
   * Converts entity to a Checkpoint DTO.
   *
   * @return \Drupal\flowdrop_stategraph\DTO\Checkpoint
   *   The checkpoint DTO.
   */
  public function toCheckpointDto(): Checkpoint;

}
