<?php
namespace WPVOID\StockBeacon\Api;
if ( ! defined( 'ABSPATH' ) ) { exit; }
abstract class RestController {
	public function can_manage(): bool { return current_user_can( 'manage_woocommerce' ); }

	/**
	 * Optional hook for centralized error reporting by host/plugin integrations.
	 */
	protected function log_exception( string $context, \Throwable $exception ): void {
		/**
		 * Fires when a REST endpoint catches an exception.
		 *
		 * @param string     $context   Endpoint context key.
		 * @param \Throwable $exception Exception instance.
		 */
		do_action( 'stockbeacon_rest_exception', $context, $exception );
	}
}
