-- Settings table for SkyCorier system configuration
CREATE TABLE settings (
    id INT AUTO_INCREMENT PRIMARY KEY,
    setting_key VARCHAR(50) UNIQUE NOT NULL,
    setting_value TEXT,
    setting_group VARCHAR(50) NOT NULL,
    setting_description VARCHAR(255),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Insert default settings
INSERT INTO settings (setting_key, setting_value, setting_group, setting_description) VALUES
-- General Settings
('site_title', 'Sky Courier', 'general', 'Website title'),
('site_description', 'Fast and reliable courier services', 'general', 'Website description'),
('admin_email', 'admin@skycourier.com', 'general', 'Admin email address'),

-- Map Settings
('google_maps_api_key', '', 'maps', 'Google Maps API Key for tracking map'),
('default_map_zoom', '10', 'maps', 'Default zoom level for tracking map'),
('map_type', 'roadmap', 'maps', 'Default map type (roadmap, satellite, hybrid, terrain)'),

-- Email Settings
('smtp_host', 'smtp.example.com', 'email', 'SMTP server hostname'),
('smtp_port', '587', 'email', 'SMTP server port'),
('smtp_username', '', 'email', 'SMTP username'),
('smtp_password', '', 'email', 'SMTP password'),
('smtp_encryption', 'tls', 'email', 'SMTP encryption (tls, ssl, or none)'),
('email_from_name', 'Sky Courier', 'email', 'From name for outgoing emails'),
('email_from_address', 'noreply@skycourier.com', 'email', 'From email address for outgoing emails');