-- Tabela para agenda de entrevistas
-- Execute este script no banco de dados

CREATE TABLE IF NOT EXISTS interview_schedules (
    id INT AUTO_INCREMENT PRIMARY KEY,
    type ENUM('interno', 'in_company') NOT NULL COMMENT 'Tipo de agendamento',
    responsible VARCHAR(255) NOT NULL COMMENT 'Responsável (entrevistador ou consultor)',
    company VARCHAR(255) NULL COMMENT 'Empresa (para entrevistas in company)',
    schedule_date DATE NOT NULL COMMENT 'Data do agendamento',
    schedule_time TIME NOT NULL COMMENT 'Horário do agendamento',
    candidate_name VARCHAR(255) NOT NULL COMMENT 'Nome do candidato',
    forwarding_status ENUM('pending', 'approved', 'rejected') NOT NULL DEFAULT 'pending' COMMENT 'Status do encaminhamento',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    INDEX idx_date (schedule_date),
    INDEX idx_type (type),
    INDEX idx_responsible (responsible),
    INDEX idx_forwarding_status (forwarding_status),
    INDEX idx_company (company),
    INDEX idx_datetime (schedule_date, schedule_time)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Agenda de entrevistas';


