<?php

declare(strict_types=1);

return [
    'queue' => env('PUBLISHING_QUEUE', 'publishing'),

    'feed' => [
        'provider' => env('PUBLISHING_FEED_PROVIDER', 'ImovelZapAi'),
        'email' => env('PUBLISHING_FEED_EMAIL'),
        'logo' => env('PUBLISHING_FEED_LOGO'),
        'telephone' => env('PUBLISHING_FEED_TELEPHONE'),
        'website' => env('PUBLISHING_FEED_WEBSITE'),
    ],

    'media' => [
        'min_width' => (int) env('PUBLISHING_MEDIA_MIN_WIDTH', 600),
        'min_height' => (int) env('PUBLISHING_MEDIA_MIN_HEIGHT', 400),
        'max_images' => (int) env('PUBLISHING_MEDIA_MAX_IMAGES', 30),
        'allowed_extensions' => ['jpg', 'jpeg', 'png', 'webp'],
        'check_accessibility' => (bool) env('PUBLISHING_MEDIA_CHECK_ACCESSIBILITY', false),
        'accessibility_timeout_seconds' => (int) env('PUBLISHING_MEDIA_ACCESSIBILITY_TIMEOUT', 5),
    ],

    'xml' => [
        'validate_xsd' => (bool) env('PUBLISHING_XML_VALIDATE_XSD', true),
        'xsd_path' => env('PUBLISHING_XML_XSD_PATH'),
    ],

    'feed_cache' => [
        'disk' => env('PUBLISHING_FEED_CACHE_DISK', 'local'),
        'path_template' => env('PUBLISHING_FEED_CACHE_PATH', 'publishing/{tenant_id}/feed.xml'),
        'max_age' => (int) env('PUBLISHING_FEED_CACHE_MAX_AGE', 300),
    ],

    'group_olx' => [
        'feed_cache' => [
            'disk' => env('PUBLISHING_GROUP_OLX_FEED_DISK', env('PUBLISHING_FEED_CACHE_DISK', 'local')),
            'path_template' => env('PUBLISHING_GROUP_OLX_FEED_PATH', 'publishing/{tenant_id}/group-olx/vrsync.xml'),
            'max_age' => (int) env('PUBLISHING_GROUP_OLX_FEED_MAX_AGE', env('PUBLISHING_FEED_CACHE_MAX_AGE', 300)),
        ],
        'storage' => [
            // local | r2
            'driver' => env('PUBLISHING_GROUP_OLX_STORAGE_DRIVER', 'local'),
            'local_disk' => env('PUBLISHING_GROUP_OLX_LOCAL_DISK', env('PUBLISHING_GROUP_OLX_FEED_DISK', 'local')),
            'r2_disk' => env('PUBLISHING_GROUP_OLX_R2_DISK', 'r2'),
            'path_prefix' => env('PUBLISHING_GROUP_OLX_STORAGE_PREFIX', 'publishing/{tenant_id}/group-olx'),
            'keep_versions' => (int) env('PUBLISHING_GROUP_OLX_KEEP_VERSIONS', 10),
        ],
    ],
];
