<?php
/**
 * VirtualStock Integration Module for Yii2
 * 
 * @author Andrew Pickstock <a.pickstock@PortalPeople.uk>
 * @copyright 2026 Portal People
 * @license MIT
 */

namespace PortalPeople\virtualstock;

use Yii;
use yii\base\Module as BaseModule;

/**
 * VirtualStock Module
 * 
 * Example configuration:
 * ```php
 * 'modules' => [
 *     'virtualstock' => [
 *         'class' => 'PortalPeople\virtualstock\Module',
 *     ],
 * ],
 * ```
 */
class Module extends BaseModule
{
    /**
     * @var string VirtualStock API endpoint
     */
    public $apiEndpoint = '';
    
    /**
     * @var string API key
     */
    public $apiKey = '';
    
    /**
     * @var string API secret
     */
    public $apiSecret = '';
    
    /**
     * {@inheritdoc}
     */
    public function init()
    {
        parent::init();
        
        // Validate required configuration
        if (empty($this->apiEndpoint)) {
            throw new \yii\base\InvalidConfigException('API endpoint must be configured.');
        }
    }
}
