<?php

declare(strict_types=1);

namespace Australcode\Rewards\Rest;

defined( 'ABSPATH' ) || exit;

/**
 * Base for REST controllers. Each controller implements register() to hook
 * rest_api_init and declare its routes under the acrwd/v1 namespace.
 *
 * Admin-facing endpoints use check_admin_permission(); Pro endpoints add a
 * server-side LicenseGate check on top (Phase 4).
 */
abstract class AbstractController {

	protected const REST_NAMESPACE = 'acrwd/v1';

	abstract public function register(): void;

	public function check_admin_permission(): bool {
		return current_user_can( 'manage_woocommerce' );
	}
}
