-- ===================================================
-- STAFF MANAGEMENT - SQL SETUP SCRIPT
-- Add staff members to users table
-- ===================================================

-- Example 1: Add a Front Desk Staff Member
INSERT INTO users (first_name, last_name, email, phone, password, user_type, is_active, created_at)
VALUES (
    'John',
    'Smith',
    'john.smith@almaris.com',
    '+1-800-ALMARIS-1',
    '$2y$10$NNvXBLtMxvHNAM9KY.CGCuYzNwZHJL6M.sFRrBJmHKxqZMH0L2m8K',
    'staff',
    1,
    NOW()
);

-- Example 2: Add a Housekeeping Staff Member
INSERT INTO users (first_name, last_name, email, phone, password, user_type, is_active, created_at)
VALUES (
    'Maria',
    'Garcia',
    'maria.garcia@almaris.com',
    '+1-800-ALMARIS-2',
    '$2y$10$NNvXBLtMxvHNAM9KY.CGCuYzNwZHJL6M.sFRrBJmHKxqZMH0L2m8K',
    'staff',
    1,
    NOW()
);

-- Example 3: Add a Concierge Staff Member
INSERT INTO users (first_name, last_name, email, phone, password, user_type, is_active, created_at)
VALUES (
    'David',
    'Johnson',
    'david.johnson@almaris.com',
    '+1-800-ALMARIS-3',
    '$2y$10$NNvXBLtMxvHNAM9KY.CGCuYzNwZHJL6M.sFRrBJmHKxqZMH0L2m8K',
    'staff',
    1,
    NOW()
);

-- Example 4: Add a Manager Staff Member
INSERT INTO users (first_name, last_name, email, phone, password, user_type, is_active, created_at)
VALUES (
    'Sarah',
    'Williams',
    'sarah.williams@almaris.com',
    '+1-800-ALMARIS-4',
    '$2y$10$NNvXBLtMxvHNAM9KY.CGCuYzNwZHJL6M.sFRrBJmHKxqZMH0L2m8K',
    'staff',
    1,
    NOW()
);

-- ===================================================
-- NOTE: All staff accounts above have password: "password123"
-- You should change these passwords immediately after creation!
--
-- To generate your own password hash in PHP:
-- $hashedPassword = password_hash('yourPassword', PASSWORD_DEFAULT);
--
-- Then use the hash in the password field above.
-- ===================================================

-- View all staff members
SELECT id, first_name, last_name, email, user_type, is_active, created_at FROM users WHERE user_type = 'staff';

-- Deactivate a staff member (disable login)
-- UPDATE users SET is_active = 0 WHERE email = 'john.smith@almaris.com';

-- Delete a staff member
-- DELETE FROM users WHERE email = 'john.smith@almaris.com' AND user_type = 'staff';

-- Update staff password
-- UPDATE users SET password = '$2y$10$NEWHASH' WHERE email = 'john.smith@almaris.com';
