CREATE TABLE consultation_requests (
    id CHAR(36) PRIMARY KEY,
    customer_id CHAR(36) NOT NULL,
    consultation_type ENUM('Free', 'Paid') NOT NULL,
    topic VARCHAR(255) NOT NULL,
    preferred_date DATE NOT NULL,
    contact_method VARCHAR(100) NOT NULL,
    status ENUM('pending', 'scheduled', 'completed', 'cancelled') DEFAULT 'pending',
    scheduled_date TIMESTAMP NULL DEFAULT NULL,
    scheduled_by CHAR(36) DEFAULT NULL,
    payment_required BOOLEAN DEFAULT FALSE,
    payment_status ENUM('pending', 'paid') DEFAULT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    FOREIGN KEY (customer_id) REFERENCES customers(id) ON DELETE RESTRICT,
    INDEX idx_customer_id (customer_id),
    INDEX idx_status (status),
    INDEX idx_scheduled_by (scheduled_by)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
