/**
 * Test Daily Threat Briefing
 * Manually triggers the briefing service and logs the results.
 */

const alertAutomationService = require('../src/services/alertAutomationService');

async function testBriefing() {
    console.log('🚀 Starting Manual Briefing Test...');
    
    try {
        const result = await alertAutomationService.runDailyBriefing({ force: true });
        
        console.log('--- TEST RESULT ---');
        console.log(JSON.stringify(result, null, 2));
        
        if (result.success) {
            console.log(`✅ Success! Generated ${result.count} alerts.`);
            console.log('Alert IDs:', result.ids);
        } else {
            console.log('❌ Failed:', result.message || result.error);
        }
        
        process.exit(result.success ? 0 : 1);
    } catch (error) {
        console.error('💥 Test Crashed:', error);
        process.exit(1);
    }
}

testBriefing();
