-- TOA Wellness Wheel Management Tables

-- Services table
CREATE TABLE IF NOT EXISTS toa_wheel_services (
    id INT PRIMARY KEY AUTO_INCREMENT,
    service_name VARCHAR(100) NOT NULL,
    service_key VARCHAR(50) NOT NULL UNIQUE,
    icon_class VARCHAR(50) NOT NULL,
    color_primary VARCHAR(7) NOT NULL,
    color_secondary VARCHAR(7) NOT NULL,
    display_order INT NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Personnel table
CREATE TABLE IF NOT EXISTS toa_wheel_personnel (
    id INT PRIMARY KEY AUTO_INCREMENT,
    service_id INT NOT NULL,
    name VARCHAR(100) NOT NULL,
    website VARCHAR(255) NOT NULL,
    display_order INT DEFAULT 0,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    FOREIGN KEY (service_id) REFERENCES toa_wheel_services(id) ON DELETE CASCADE
);

-- Insert default services
INSERT INTO toa_wheel_services (service_name, service_key, icon_class, color_primary, color_secondary, display_order) VALUES
('Business Coaching', 'business', 'fas fa-building', '#FF6B6B', '#FF4757', 1),
('Notary & Loan Signing', 'notary', 'fas fa-shield-alt', '#4ECDC4', '#26D0CE', 2),
('Crypto & Commodities', 'crypto', 'fas fa-chart-line', '#45B7D1', '#3742FA', 3),
('Tax & Bookkeeping', 'tax', 'fas fa-calculator', '#96CEB4', '#2ED573', 4),
('IT Solutions', 'it', 'fas fa-laptop', '#FECA57', '#FF9F43', 5),
('Estate Planning', 'estate', 'fas fa-file-alt', '#FF9FF3', '#F368E0', 6),
('Business Branding', 'branding', 'fas fa-palette', '#A55EEA', '#8B5CF6', 7),
('Real Estate Services', 'realestate', 'fas fa-home', '#26DE81', '#20BF6B', 8);

-- Insert default personnel
INSERT INTO toa_wheel_personnel (service_id, name, website, display_order) VALUES
-- Business Coaching
(1, 'Alex Johnson', 'https://alexjohnsoncoaching.com', 1),
(1, 'Sarah Williams', 'https://sarahbizcoach.com', 2),
(1, 'Michael Davis', 'https://michaelstrategy.com', 3),

-- Notary & Loan Signing
(2, 'Sarah Miller', 'https://sarahmillernotary.com', 1),
(2, 'John Thompson', 'https://johnnotaryservices.com', 2),
(2, 'Lisa Garcia', 'https://lisanotarypro.com', 3),

-- Crypto & Commodities
(3, 'Marcus Chen', 'https://marcuschentrading.com', 1),
(3, 'James Rodriguez', 'https://cryptowithjames.com', 2),
(3, 'Emily Foster', 'https://emilycryptoadvice.com', 3),

-- Tax & Bookkeeping
(4, 'Elena Rodriguez', 'https://elenarodrigueztax.com', 1),
(4, 'David Martinez', 'https://davidtaxpro.com', 2),
(4, 'Rachel Kim', 'https://rachelaccounting.com', 3),

-- IT Solutions
(5, 'David Park', 'https://davidparktech.com', 1),
(5, 'Thomas Lee', 'https://techwithtom.com', 2),
(5, 'Jessica Wong', 'https://jessicaitsolutions.com', 3),

-- Estate Planning
(6, 'Jordan Smith', 'https://jordansmithlaw.com', 1),
(6, 'Robert Johnson', 'https://robertestateplanning.com', 2),
(6, 'Maria Gonzalez', 'https://mariaestatepro.com', 3),

-- Business Branding
(7, 'Taylor Reed', 'https://taylorreeddesign.com', 1),
(7, 'Carlos Rivera', 'https://creativewithcarlos.com', 2),
(7, 'Amanda Clark', 'https://amandabrandstudio.com', 3),

-- Real Estate Services
(8, 'Morgan Vance', 'https://morganvancerealty.com', 1),
(8, 'Kevin Brown', 'https://kevinrealtygroup.com', 2),
(8, 'Nicole Taylor', 'https://nicolerealestate.com', 3);