<?php

return [

    /*
    |--------------------------------------------------------------------------
    | HubSpot API Configuration
    |--------------------------------------------------------------------------
    |
    | Configuration for HubSpot API integration used for synchronizing
    | committee and workgroup users to HubSpot contact lists.
    |
    */

    /**
     * HubSpot API Access Token (Private App Token)
     * Generate from: HubSpot Settings > Integrations > Private Apps
     * Required scopes: crm.lists.read, crm.lists.write, crm.objects.contacts.read, crm.objects.contacts.write
     */
    'access_token' => env('HUBSPOT_ACCESS_TOKEN', ''),

    /**
     * Enable or disable HubSpot synchronization
     */
    'sync_enabled' => env('HUBSPOT_SYNC_ENABLED', false),

    /**
     * Suffix to append to list names to identify server-managed lists
     * Format: "{Committee/WorkGroup Title} (Server Sync)"
     */
    'list_suffix' => env('HUBSPOT_LIST_SUFFIX', '(Server Sync)'),

    /**
     * Prefix for list names (optional)
     * Can be used to organize lists: "EFET - {Title} (Server Sync)"
     */
    'list_prefix' => env('HUBSPOT_LIST_PREFIX', ''),

    /**
     * Language to use for committee/workgroup titles
     * Default: 'en' (English)
     */
    'title_language' => env('HUBSPOT_TITLE_LANGUAGE', 'en'),

    /**
     * Rate limiting configuration
     * HubSpot API has rate limits (100 requests/10 seconds for free tier)
     */
    'rate_limit' => [
        /**
         * Delay between API batch operations in milliseconds
         */
        'delay_ms' => env('HUBSPOT_RATE_LIMIT_DELAY_MS', 200),

        /**
         * Number of contacts to process per batch
         */
        'batch_size' => env('HUBSPOT_BATCH_SIZE', 100),

        /**
         * Maximum retry attempts for failed requests
         */
        'max_retries' => env('HUBSPOT_MAX_RETRIES', 3),

        /**
         * Delay between retries in milliseconds (exponential backoff base)
         */
        'retry_delay_ms' => env('HUBSPOT_RETRY_DELAY_MS', 1000),
    ],

    /**
     * Email report configuration
     */
    'email_report' => [
        /**
         * Default recipients for sync reports (comma-separated)
         */
        'recipients' => env('HUBSPOT_REPORT_RECIPIENTS', 'christian.freitas@eae.pt,m.cubelic@energytraderseurope.org,alex@eae.pt,antonio@eae.pt'),

        /**
         * Send report only on errors
         */
        'only_on_error' => env('HUBSPOT_REPORT_ONLY_ON_ERROR', false),
    ],

    /**
     * Sync schedule configuration
     */
    'schedule' => [
        /**
         * Time to run daily sync (24h format)
         */
        'time' => env('HUBSPOT_SYNC_TIME', '06:00'),
    ],

    /**
     * Contact sync property configuration
     * Used to identify contacts managed by the server sync
     */
    'contact_property' => [
        /**
         * Property name to mark contacts as server-synced
         * This property will be created in HubSpot if it doesn't exist
         */
        'name' => env('HUBSPOT_SYNC_PROPERTY_NAME', 'server_sync_source'),

        /**
         * Property label (display name in HubSpot)
         */
        'label' => env('HUBSPOT_SYNC_PROPERTY_LABEL', 'Server Sync Source'),

        /**
         * Value to set for synced contacts
         */
        'value' => env('HUBSPOT_SYNC_PROPERTY_VALUE', 'efet_intranet'),

        /**
         * Property group in HubSpot
         */
        'group' => env('HUBSPOT_SYNC_PROPERTY_GROUP', 'contactinformation'),
    ],

];
