<?php
declare(strict_types=1);

namespace App\Foundation;

final class CompatibilityBridge
{
    /** @return array<string,array<string,mixed>> */
    public static function legacyModules(): array
    {
        return [
            'cda.clients' => ['name' => 'Adhérents & familles', 'legacy' => true, 'version' => '7.x'],
            'cda.professors' => ['name' => 'Professeurs', 'legacy' => true, 'version' => '7.x'],
            'cda.workshops' => ['name' => 'Ateliers', 'legacy' => true, 'version' => '7.x'],
            'cda.groups' => ['name' => 'Groupes', 'legacy' => true, 'version' => '7.x'],
            'cda.pricing' => ['name' => 'Tarification', 'legacy' => true, 'version' => '7.x'],
            'cda.communication' => ['name' => 'Communication', 'legacy' => true, 'version' => '7.x'],
            'cda.security' => ['name' => 'Sécurité', 'legacy' => true, 'version' => '7.2.2'],
        ];
    }

    public static function registerLegacyModules(ModuleRegistry $registry): void
    {
        foreach (self::legacyModules() as $code => $definition) {
            $registry->register($code, $definition);
        }
    }
}
