-- Baltique OS Core 0.5 — Communication Engine
-- Adds real email queue configuration defaults. No EDM/P1/KSeF duplication.
SET NAMES utf8mb4;

INSERT INTO app_settings (setting_key, setting_value, created_at, updated_at) VALUES
('core_version','0.5.0',NOW(),NOW()),
('communication_engine_enabled','1',NOW(),NOW()),
('communication_email_enabled','0',NOW(),NOW()),
('communication_email_mode','smtp',NOW(),NOW()),
('communication_safe_mode','1',NOW(),NOW()),
('communication_batch_limit','20',NOW(),NOW()),
('communication_max_attempts','3',NOW(),NOW()),
('communication_cron_token', SUBSTRING(SHA2(CONCAT(UUID(), RAND(), NOW()), 256), 1, 48), NOW(), NOW()),
('smtp_host','',NOW(),NOW()),
('smtp_port','587',NOW(),NOW()),
('smtp_encryption','starttls',NOW(),NOW()),
('smtp_username','',NOW(),NOW()),
('smtp_password','',NOW(),NOW()),
('smtp_from_email','kontakt@baltique.pl',NOW(),NOW()),
('smtp_from_name','Baltique',NOW(),NOW()),
('smtp_reply_to','',NOW(),NOW())
ON DUPLICATE KEY UPDATE updated_at=NOW();
