<?php
/**
 * Route Contract
 *
 * @package Licenzo\Framework\Contracts\Router
 */

namespace Licenzo\Framework\Contracts\Router;

use Licenzo\Framework\Http\Request;

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}

/**
 * Route interface for individual HTTP routes
 */
interface Route
{
    /**
     * Get the HTTP method for this route
     *
     * @return string
     */
    public function getMethod();

    /**
     * Get the URI pattern for this route
     *
     * @return string
     */
    public function getUri();

    /**
     * Get the action (controller/method) for this route
     *
     * @return mixed
     */
    public function getAction();

    /**
     * Get the middleware assigned to this route
     *
     * @return array
     */
    public function getMiddleware();

    /**
     * Get the policy assigned to this route
     *
     * @return string|null
     */
    public function getPolicy();

    /**
     * Get the name of this route
     *
     * @return string|null
     */
    public function getName();

    /**
     * Get the prefix for this route
     *
     * @return string
     */
    public function getPrefix();

    /**
     * Add middleware to this route
     *
     * @param string|array $middleware
     * @return self
     */
    public function middleware(string|array $middleware);

    /**
     * Add a policy to this route
     *
     * @param string $policy
     * @return self
     */
    public function policy(string $policy);

    /**
     * Set the name for this route
     *
     * @param string $name
     * @return self
     */
    public function name(string $name);

    /**
     * Check if this route matches the given request
     *
     * @param Request $request
     * @return bool
     */
    public function matches(Request $request);
}
