<?php

/**
 * Tutorial API Functions
 */

if (!defined('ABSPATH')) {
  exit;
}

/**
 * Get tutorial status
 * 
 * @return WP_REST_Response API Response
 */
function content_craft_ai_get_tutorial_status()
{
  // Check if tutorial should be shown
  $should_show = ContentCraftAI_TutorialManager::should_show_tutorial();
  $status = ContentCraftAI_TutorialManager::get_tutorial_status();

  return rest_ensure_response([
    'success' => true,
    'should_show' => $should_show,
    'status' => $status
  ]);
}

/**
 * Mark tutorial as shown
 * 
 * @return WP_REST_Response API Response
 */
function content_craft_ai_mark_tutorial_shown()
{
  // Mark tutorial as shown
  $success = ContentCraftAI_TutorialManager::mark_tutorial_shown();

  return rest_ensure_response([
    'success' => $success
  ]);
}
