<?php

declare(strict_types=1);

namespace CloudXM\SDK\Contracts;

/**
 * Configuration interface for CloudXM plugins
 *
 * Defines the contract for plugin configuration classes that provide
 * version information, environment settings, debug state, and plugin identity.
 */
interface ConfigurationInterface
{
    /**
     * Get the plugin version
     */
    public function getVersion(): string;

    /**
     * Check if debug mode is enabled
     */
    public function isDebug(): bool;

    /**
     * Get current environment (production|sandbox|development)
     */
    public function getEnvironment(): string;

    /**
     * Get the plugin name (e.g., 'marlim', 'envioz', 'nfse')
     */
    public function getPluginName(): string;

    /**
     * Get the plugin file path
     */
    public function getPluginFilePath(): string;

    /**
     * Get the absolute path to the plugin directory
     */
    public function getPluginDirPath(): string;

    /**
     * Get a configuration value by key with optional default
     *
     * @param string $key Configuration key
     * @param mixed $default Default value if key not found
     * @return mixed Configuration value
     */
    public function get(string $key, $default = null);

    /**
     * Check if a configuration key exists
     *
     * @param string $key Configuration key
     * @return bool True if key exists, false otherwise
     */
    public function has(string $key): bool;

    /**
     * Get the database table prefix for this plugin
     *
     * @return string Database table prefix (e.g., 'marlim_', 'envioz_', 'nfse_')
     */
    public function getTablePrefix(): string;
}