<?php

namespace modules\hse;

use Yii;

/**
 * HSE Fatigue & Risk Calculator Module
 *
 * This module provides HSE-compliant fatigue and risk index calculations
 * for shift work patterns. It can be integrated into any Yii2 application.
 */
class Module extends \yii\base\Module
{
    public $controllerNamespace = 'modules\hse\controllers';

    public function init()
    {
        parent::init();

        // Register translations if needed
        if (!isset(Yii::$app->i18n->translations['hse*'])) {
            Yii::$app->i18n->translations['hse*'] = [
                'class' => 'yii\i18n\PhpMessageSource',
                'sourceLanguage' => 'en-US',
                'basePath' => '@modules/hse/messages',
            ];
        }
        \Yii::$app->urlManager->addRules([
            'calculator/<action:[\w\-]+>' => 'hse/calculator/<action>',
            'exceedance/<action:[\w\-]+>' => 'hse/exceedance/<action>',
        ]);
    }
}