-- Seed data: categories, starter interests, and YOUR admin account.
-- Run AFTER schema.sql

SET NAMES utf8mb4;

INSERT INTO library_categories (name, slug, icon, sort_order) VALUES
  ('Tools',              'tools',              'wrench',   10),
  ('Lawn & Garden',      'lawn-garden',        'leaf',     20),
  ('Lake Life',          'lake-life',          'paddle',   30),
  ('Home Improvement',   'home-improvement',   'house',    40),
  ('Skills & Services',  'skills-services',    'bulb',     50),
  ('Kids & Family',      'kids-family',        'family',   60),
  ('Automotive',         'automotive',         'car',      70),
  ('Party & Events',     'party-events',       'party',    80)
ON DUPLICATE KEY UPDATE name = VALUES(name);

INSERT INTO resource_categories (name, slug, sort_order) VALUES
  ('Trash & Recycling',   'trash-recycling',  10),
  ('Utilities',           'utilities',        20),
  ('Schools',             'schools',          30),
  ('HOA & Governance',    'hoa',              40),
  ('Trusted Vendors',     'vendors',          50),
  ('Emergency & Safety',  'emergency',        60),
  ('Around Lake Wylie',   'lake-wylie',       70)
ON DUPLICATE KEY UPDATE name = VALUES(name);

INSERT INTO interests (name, slug, category) VALUES
  ('Home Theater',     'home-theater',     'Tech'),
  ('3D Printing',      '3d-printing',      'Tech'),
  ('Smart Home',       'smart-home',       'Tech'),
  ('Photography',      'photography',      'Creative'),
  ('Woodworking',      'woodworking',      'Making'),
  ('Vinyl Cutting',    'vinyl-cutting',    'Making'),
  ('Lawn Care',        'lawn-care',        'Outdoors'),
  ('Gardening',        'gardening',        'Outdoors'),
  ('Kayaking',         'kayaking',         'Lake'),
  ('Boating',          'boating',          'Lake'),
  ('Fishing',          'fishing',          'Lake'),
  ('Golf',             'golf',             'Sports'),
  ('Pickleball',       'pickleball',       'Sports'),
  ('Running',          'running',          'Sports'),
  ('Cooking & BBQ',    'cooking-bbq',      'Food'),
  ('Wine & Craft Beer','wine-craft-beer',  'Food'),
  ('Music',            'music',            'Creative'),
  ('Cars & Motorsport','cars-motorsport',  'Hobbies'),
  ('Dogs',             'dogs',             'Pets'),
  ('Book Club',        'book-club',        'Social'),
  ('Volunteering',     'volunteering',     'Social'),
  ('Board Games',      'board-games',      'Social')
ON DUPLICATE KEY UPDATE name = VALUES(name);

-- -------------------------------------------------------------------
-- BOOTSTRAP ADMIN
-- Change the email to the one you'll sign in with via Google/Microsoft.
-- On first federated login the app links your identity to this row.
-- -------------------------------------------------------------------
INSERT INTO users (email, display_name, first_name, last_name, role, status, city, state, approved_at)
VALUES ('steve@example.com', 'Steve Czaikowski', 'Steve', 'Czaikowski', 'admin', 'approved', 'Lake Wylie', 'SC', NOW())
ON DUPLICATE KEY UPDATE role = 'admin', status = 'approved';

-- -------------------------------------------------------------------
-- COMMUNITY ADDRESS ALLOW-LIST (examples - replace with the real plat)
-- Tip: bulk load from CSV:
--   LOAD DATA LOCAL INFILE 'addresses.csv' INTO TABLE community_addresses
--   FIELDS TERMINATED BY ',' IGNORE 1 LINES (street_number, street_name, postal_code);
-- -------------------------------------------------------------------
INSERT IGNORE INTO community_addresses (street_number, street_name, postal_code) VALUES
  ('100', 'Paddlers Cove Drive', '29710'),
  ('102', 'Paddlers Cove Drive', '29710'),
  ('104', 'Paddlers Cove Drive', '29710');
