-- Store Settings Table
CREATE TABLE IF NOT EXISTS site_settings (
    id INT PRIMARY KEY AUTO_INCREMENT,
    setting_key VARCHAR(100) UNIQUE NOT NULL,
    setting_value TEXT,
    setting_type VARCHAR(20) DEFAULT 'text',
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    updated_by INT
);

-- Insert default settings
INSERT INTO site_settings (setting_key, setting_value, setting_type) VALUES
('store_name', 'Awesome Mall', 'text'),
('store_tagline', 'Your One-Stop Shopping Destination', 'text'),
('currency_code', 'GHS', 'text'),
('currency_symbol', '₵', 'text'),
('timezone', 'Africa/Accra', 'text'),
('support_email', 'support@awesomemall.com', 'email'),
('support_phone', '+233 123 456 789', 'text'),
('tax_rate', '0', 'number'),
('shipping_fee', '0', 'number'),
('meta_description', 'Shop the latest products at Awesome Mall - Electronics, Fashion, Home & More!', 'text'),
('meta_keywords', 'shopping, online store, ghana, electronics, fashion', 'text'),
('enable_vendor_registration', '0', 'boolean'),
('vendor_commission_rate', '10', 'number'),
('min_order_amount', '0', 'number'),
('enable_reviews', '1', 'boolean'),
('enable_wishlist', '1', 'boolean'),
('items_per_page', '20', 'number')
ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value);
