-- Reset all sales data while keeping products
-- This script deletes orders, chits, and order_tickets
-- and resets quantity_sold on event_tickets

-- Delete in correct order due to foreign key constraints

-- 1. Delete all chits (menu item orders)
DELETE FROM chits;

-- 2. Delete all order tickets
DELETE FROM order_tickets;

-- 3. Delete all orders
DELETE FROM orders;

-- 4. Reset quantity_sold on all event tickets back to 0
UPDATE event_tickets SET quantity_sold = 0;

-- Verify the reset
SELECT 'orders' as table_name, COUNT(*) as count FROM orders
UNION ALL
SELECT 'chits' as table_name, COUNT(*) as count FROM chits
UNION ALL
SELECT 'order_tickets' as table_name, COUNT(*) as count FROM order_tickets;
