-- ============================================================
-- Grubflip test data seed
-- Run against grubflip_dev database
-- Author: Luna (@luna) — QA
-- ============================================================

-- Test restaurant
INSERT IGNORE INTO restaurants (id, name, slug, address, phone, status, created_at)
VALUES
    (9001, 'QA Test Restaurant', 'qa-test-restaurant', '123 Test St', '555-0100', 'active', NOW()),
    (9002, 'QA Inactive Restaurant', 'qa-inactive', '456 Test Ave', '555-0200', 'inactive', NOW());

-- Test menu
INSERT IGNORE INTO menus (id, restaurant_id, name, status, created_at)
VALUES
    (9001, 9001, 'QA Test Menu', 'active', NOW()),
    (9002, 9001, 'QA Draft Menu', 'draft', NOW());

-- Test menu items
INSERT IGNORE INTO menu_items (id, menu_id, name, description, price, category, status, created_at)
VALUES
    (9001, 9001, 'QA Burger', 'Test burger for QA', 9.99, 'Entrees', 'active', NOW()),
    (9002, 9001, 'QA Fries', 'Test fries for QA', 4.99, 'Sides', 'active', NOW()),
    (9003, 9001, 'QA Shake', 'Test milkshake for QA', 5.99, 'Drinks', 'active', NOW()),
    (9004, 9002, 'QA Draft Item', 'Should not appear in active queries', 7.99, 'Entrees', 'draft', NOW());

-- Test users
INSERT IGNORE INTO users (id, email, name, phone, status, created_at)
VALUES
    (9001, 'qa-user@test.payfrit.com', 'QA Test User', '555-0001', 'active', NOW()),
    (9002, 'qa-admin@test.payfrit.com', 'QA Admin User', '555-0002', 'active', NOW());

-- Test orders
INSERT IGNORE INTO orders (id, user_id, restaurant_id, status, total, created_at)
VALUES
    (9001, 9001, 9001, 'completed', 14.98, NOW()),
    (9002, 9001, 9001, 'pending', 9.99, NOW()),
    (9003, 9001, 9001, 'cancelled', 5.99, NOW());

-- Cleanup query (run manually when done testing):
-- DELETE FROM orders WHERE id BETWEEN 9001 AND 9099;
-- DELETE FROM menu_items WHERE id BETWEEN 9001 AND 9099;
-- DELETE FROM menus WHERE id BETWEEN 9001 AND 9099;
-- DELETE FROM restaurants WHERE id BETWEEN 9001 AND 9099;
-- DELETE FROM users WHERE id BETWEEN 9001 AND 9099;
