-- ========================================
-- INSERIR NOVA EMPRESA: Leader Tecnologia LTDA (VERSÃO CORRIGIDA)
-- ========================================

-- 1. Inserir a empresa Leader Tecnologia
INSERT INTO core_business.companies (
    name,
    description,
    email,
    phone,
    website,
    address,
    active_plan,
    max_users,
    max_social_accounts,
    max_posts_per_month,
    max_storage_gb,
    features,
    status,
    registration_date,
    expiration_date,
    billing_info,
    settings,
    deleted,
    created_at,
    updated_at
) VALUES (
    'Leader Tecnologia LTDA',
    'Empresa especializada em desenvolvimento de software e soluções tecnológicas inovadoras',
    'contato2@leadertecnologia.com',
    '+55 11 3456-7890',
    'https://www.leadertecnologia.com',
    '{
        "street": "Rua das Tecnologias, 123",
        "neighborhood": "Vila Olímpia",
        "city": "São Paulo",
        "state": "SP",
        "postal_code": "04551-000",
        "country": "Brasil",
        "complement": "Sala 456"
    }',
    'PROFESSIONAL',
    50,
    10,
    1000,
    100.0,
    '{
        "analytics": true,
        "automation": true,
        "collaboration": true,
        "advancedReports": true
    }',
    'ATIVO',
    CURRENT_TIMESTAMP,
    '2026-08-22 23:59:59',
    '{
        "billing_address": {
            "street": "Rua das Tecnologias, 123",
            "city": "São Paulo",
            "state": "SP",
            "postal_code": "04551-000",
            "country": "Brasil"
        },
        "payment_method": "credit_card",
        "billing_cycle": "annual"
    }',
    '{
        "language": "pt-BR",
        "timezone": "America/Sao_Paulo",
        "notifications": {
            "push": true,
            "email": true
        },
        "social_media_preferences": {
            "auto_publish": false,
            "content_approval": true,
            "analytics_frequency": "weekly"
        }
    }',
    false,
    CURRENT_TIMESTAMP,
    CURRENT_TIMESTAMP
);

-- ========================================
-- VERIFICAÇÃO DOS DADOS INSERIDOS
-- ========================================

-- Verificar a empresa criada
SELECT 
    id,
    name,
    email,
    website,
    active_plan,
    status
FROM core_business.companies 
WHERE name = 'Leader Tecnologia LTDA';
