-- VisualGen AI Database Seed Script
-- All UUIDs are pre-defined or generated cleanly.

-- 1. Default Settings
INSERT INTO `settings` (`skey`, `svalue`) VALUES
('free_starter_credits', '15'),
('free_daily_credits', '3'),
('max_prompt_length', '250'),
('maintenance_mode', '0'),
('min_app_version_code', '1'),
('watermark_enabled', '1'),
('watermark_text', 'VisualGen AI'),
('max_generations_per_day_per_user', '50'),
('privacy_policy_url', 'https://image.noyonshop.com/privacy-policy.html'),
('terms_url', 'https://image.noyonshop.com/delete-account.html');

-- 2. Providers
-- API keys are AES-256-GCM encrypted placeholders (using standard helper formats)
-- We seed with active providers. Priority 1 = Gemini, Priority 2 = OpenAI
INSERT INTO `providers` (`id`, `name`, `model_name`, `api_key_encrypted`, `is_active`, `priority`, `daily_limit`, `used_today`, `last_error`, `created_at`) VALUES
('p_gemini_01', 'gemini', 'gemini-1.5-flash', 'U0VFRF9LRVlfR0VNSU5JX1BMQUNFSE9MREVS', 1, 1, 1000, 0, NULL, NOW()),
('p_openai_02', 'openai', 'dall-e-3', 'U0VFRF9LRVlfT1BFTkFJX1BMQUNFSE9MREVS', 1, 2, 500, 0, NULL, NOW());

-- 3. Plans
INSERT INTO `plans` (`id`, `name`, `google_product_id`, `credits_per_period`, `watermark_free`, `period_days`, `is_active`) VALUES
('p_tier_free', 'Free Starter', 'retro_free_starter', 0, 0, 9999, 1),
('p_tier_silver', 'Silver Neon Plus', 'retro_silver_neon_monthly', 150, 1, 30, 1),
('p_tier_gold', 'Gold Synth VIP', 'retro_gold_synth_monthly', 500, 1, 30, 1);

-- 4. Categories
INSERT INTO `categories` (`id`, `name`, `icon`, `sort_order`, `is_active`) VALUES
('cat_80s_vibe', '80s Vibes', 'ic_vibe_80s', 1, 1),
('cat_vintage_tech', 'Vintage Tech', 'ic_vintage_tech', 2, 1);

-- 5. Templates
-- 6 templates with customized retro prompt descriptions and JSON sample outputs
INSERT INTO `templates` (`id`, `category_id`, `title`, `description`, `preview_image`, `sample_outputs`, `prompt_text`, `negative_prompt`, `is_premium`, `is_trending`, `credit_cost`, `sort_order`, `use_count`, `is_active`, `created_at`) VALUES
-- Polaroid (1)
('t_polaroid_80', 'cat_80s_vibe', '80s Polaroid Snap', 'Authentic vintage Polaroid image with soft colors, square format borders, and unique flash leaks.', 
'uploads/templates/polaroid_prev.jpg', 
'["uploads/templates/samples/polaroid_sample1.jpg", "uploads/templates/samples/polaroid_sample2.jpg"]',
'An authentic 1980s Polaroid instant photo, square visual format, vintage color fading, washed-out shadows, overexposed flash on the subject faces, heavy warm retro grains, vintage physical borders.',
'modern cameras, high-definition, sharp digital lines, borderless, 8k, photorealistic rendering',
0, 1, 1, 1, 48, 1, NOW()),

-- VHS Video (2)
('t_vhs_glitch', 'cat_80s_vibe', 'VHS Retro Glitch', 'Relive the videotape age with interlaced lines, visual noise, magnetic tracking glitches, and date overlays.',
'uploads/templates/vhs_prev.jpg',
'["uploads/templates/samples/vhs_sample1.jpg"]',
'A screen capture from an old 1980s VHS tape, scanlines, video tracking errors, heavy magnetic color bleeding, pixelated digital clock time overlay in bright neon orange "SEP 24 1986", vintage low resolution scan.',
'hd, smooth gradients, crisp text, vector art, modern layout',
0, 0, 1, 2, 34, 1, NOW()),

-- Synthwave (3)
('t_synthwave_sunset', 'cat_80s_vibe', 'Outrun Synthwave', 'Immerse your photo in neon grids, wireframe horizons, vector mountains, and glowing lasers.',
'uploads/templates/synthwave_prev.jpg',
'["uploads/templates/samples/synthwave_sample1.jpg"]',
'Synthwave aesthetic style. The subject is integrated into a neon grid horizon, glowing purple and magenta lasers, wireframe digital vector mountains in the background, outrun retro-futurism sunset style, low-poly aesthetics.',
'realistic landscapes, daylight, boring colors, black and white',
1, 1, 2, 3, 112, 1, NOW()),

-- Yearbook (4)
('t_yearbook_89', 'cat_vintage_tech', '1989 School Yearbook', 'Classic retro high-school studio backdrop with neon blue laser lines and retro styled portrait soft-filters.',
'uploads/templates/yearbook_prev.jpg',
'["uploads/templates/samples/yearbook_sample1.jpg"]',
'1989 classic high school yearbook portrait photo, soft warm focus portrait lens, iconic neon laser stream pattern background (blue and magenta crossing lines), styled wardrobe, nostalgic school studio lighting.',
'outdoor lighting, dynamic sun flares, modern digital filters, futuristic textures',
0, 0, 1, 4, 15, 1, NOW()),

-- Arcade Neon (5)
('t_arcade_glory', 'cat_vintage_tech', 'Arcade Neon Hall', 'Surround yourself with glowing arcade cabinets, retro joystick cabinets, and classic pixel cabinet screens.',
'uploads/templates/arcade_prev.jpg',
'["uploads/templates/samples/arcade_sample1.jpg"]',
'Subject standing inside a crowded 1980s retro video game arcade hall, neon lights from Pac-man and Galaga cabinets illuminating faces, dense smoke haze, CRT screen reflections, heavy grain scan, vintage color saturation.',
'modern flat screens, modern consoles, minimalist flat design, empty room',
1, 1, 2, 5, 87, 1, NOW()),

-- Mall Photoshoot (6)
('t_mall_glamour', 'cat_vintage_tech', 'Retro Mall Photoshoot', 'Classic vintage Glamour Shots style with double-exposures, soft fog filters, and airbrushed portraits.',
'uploads/templates/mall_prev.jpg',
'["uploads/templates/samples/mall_sample1.jpg"]',
'1980s mall glamour portrait style, double exposure with a smaller transparent floating head portrait, ultra soft focus lens filter, pink airbrushed background vignette, bright pastel makeup, iconic nostalgic mall photography.',
'monochrome, modern high fashion, low key lighting, gritty texture, raw photo',
0, 1, 1, 6, 23, 1, NOW());
