<?php
declare(strict_types=1);

namespace ROITheme\Admin\ThemeSettings\Infrastructure\FieldMapping;

use ROITheme\Admin\Shared\Domain\Contracts\FieldMapperInterface;

/**
 * Field Mapper para Theme Settings
 *
 * RESPONSABILIDAD:
 * - Mapear field IDs del formulario a atributos de BD
 * - Solo conoce sus propios campos (modularidad)
 *
 * NOTA: Logo/branding se gestiona desde el componente navbar
 */
final class ThemeSettingsFieldMapper implements FieldMapperInterface
{
    public function getComponentName(): string
    {
        return 'theme-settings';
    }

    public function getFieldMapping(): array
    {
        return [
            // Analytics
            'themeSettingsGaTrackingId' => ['group' => 'analytics', 'attribute' => 'ga_tracking_id'],
            'themeSettingsGaAnonymizeIp' => ['group' => 'analytics', 'attribute' => 'ga_anonymize_ip'],

            // AdSense
            'themeSettingsAdsensePublisherId' => ['group' => 'adsense', 'attribute' => 'adsense_publisher_id'],
            'themeSettingsAdsenseAutoAds' => ['group' => 'adsense', 'attribute' => 'adsense_auto_ads'],

            // Custom Code
            'themeSettingsCustomCss' => ['group' => 'custom_code', 'attribute' => 'custom_css'],
            'themeSettingsCustomJsHeader' => ['group' => 'custom_code', 'attribute' => 'custom_js_header'],
            'themeSettingsCustomJsFooter' => ['group' => 'custom_code', 'attribute' => 'custom_js_footer'],
        ];
    }
}
