<?php

declare(strict_types=1);

namespace PortalPeople\wordpressbridge\controllers\api;

use OpenApi\Annotations as OA;
use Yii;
use yii\rest\Controller;

/**
 * @OA\Tag(name="WordPressBridge", description="WordPress integration endpoints")
 */
class WpController extends Controller
{
    /** Sample availability check for a date range and centre. */
    public function actionSample(): void
    {
        /** @var \PortalPeople\wordpressbridge\Module $module */
        $module = Yii::$app->getModule('ngauge-wordpress-bridge');
        $module->getWpService()->sample();
    }

    /** Create a WordPress webhook record. */
    public function actionCreate(): string
    {
        /** @var \PortalPeople\wordpressbridge\Module $module */
        $module = Yii::$app->getModule('ngauge-wordpress-bridge');
        return $module->getWpService()->create();
    }
}
