

-- Insert test products
INSERT INTO products (name, description, price, currency, stock_quantity, category, image_url, is_active) VALUES
('Wireless Headphones', 'High-quality wireless noise-canceling headphones', 199.99, 'USD', 50, 'Electronics', 'image1.jpg', 1),
('Smartphone', 'Latest model smartphone with AI camera', 799.99, 'USD', 30, 'Electronics', 'image2.jpg', 1),
('Laptop', 'Lightweight laptop with long battery life', 999.99, 'USD', 20, 'Computers', 'image3.jpg', 1);

-- Insert test orders
INSERT INTO orders (user_id, total_amount, currency, payment_status, order_status, shipping_address_id) VALUES
(1, 999.99, 'USD', 'paid', 'shipped', 1),
(2, 199.99, 'USD', 'pending', 'processing', 2);

-- Insert test order items
INSERT INTO order_items (order_id, product_id, quantity, unit_price, total_price) VALUES
(1, 3, 1, 999.99, 999.99),
(2, 1, 1, 199.99, 199.99);

-- Insert test discount codes
INSERT INTO discounts (code, discount_type, discount_value, min_order_amount, max_uses, uses_remaining, start_date, end_date, is_active) VALUES
('SUMMER10', 'percentage', 10.00, 50.00, 100, 100, NOW(), DATE_ADD(NOW(), INTERVAL 30 DAY), 1),
('WELCOME5', 'fixed', 5.00, NULL, 50, 50, NOW(), DATE_ADD(NOW(), INTERVAL 60 DAY), 1);

-- Insert test order discount applications
INSERT INTO order_discounts (order_id, discount_id, discount_amount) VALUES
(1, 1, 99.99),
(2, 2, 5.00);

-- Insert test BNPL transactions
INSERT INTO bnpl_transactions (user_id, order_id, bnpl_provider, bnpl_status, total_amount, installment_amount, installment_count, due_next) VALUES
(1, 1, 'Afterpay', 'approved', 999.99, 249.99, 4, DATE_ADD(NOW(), INTERVAL 30 DAY));

-- Insert test upsell recommendations
INSERT INTO upsell_recommendations (base_product_id, upsell_product_id) VALUES
(1, 2),
(2, 3);

-- Insert test cross-sell recommendations
INSERT INTO cross_sell_recommendations (base_product_id, cross_sell_product_id) VALUES
(1, 3),
(2, 1);

-- Insert test login history
INSERT INTO login_history (user_id, login_time, login_ip, user_agent, success) VALUES
(1, NOW(), '192.168.1.1', 'Mozilla/5.0 (Windows NT 10.0; Win64)', 1),
(2, NOW(), '192.168.1.2', 'Mozilla/5.0 (Macintosh; Intel Mac OS X)', 1);
