<?php

declare(strict_types=1);

namespace Drupal\flowdrop_interrupt\Enum;

/**
 * Defines the types of interrupts supported by the system.
 *
 * @api
 */
enum InterruptType: string {

  // Confirmation interrupt - Yes/No, Approve/Reject decisions.
  case Confirmation = 'confirmation';

  // Choice interrupt - Single or multiple selection from options.
  case Choice = 'choice';

  // Text interrupt - Free-form text input.
  case Text = 'text';

  // Form interrupt - Full JSON Schema-based form input.
  case Form = 'form';

  /**
   * Gets a human-readable label for the interrupt type.
   *
   * @return string
   *   The label.
   */
  public function label(): string {
    return match ($this) {
      self::Confirmation => 'Confirmation',
      self::Choice => 'Choice',
      self::Text => 'Text Input',
      self::Form => 'Form',
    };
  }

  /**
   * Gets a description of the interrupt type.
   *
   * @return string
   *   The description.
   */
  public function description(): string {
    return match ($this) {
      self::Confirmation => 'Yes/No or Approve/Reject decision',
      self::Choice => 'Single or multiple selection from options',
      self::Text => 'Free-form text input',
      self::Form => 'Structured form based on JSON Schema',
    };
  }

}
