-- Add payment related columns to the orders table
ALTER TABLE orders ADD COLUMN IF NOT EXISTS payment_completed BOOLEAN DEFAULT FALSE;
ALTER TABLE orders ADD COLUMN IF NOT EXISTS payment_id VARCHAR(255);
ALTER TABLE orders ADD COLUMN IF NOT EXISTS payment_method VARCHAR(50);
ALTER TABLE orders ADD COLUMN IF NOT EXISTS payment_notes TEXT;

-- Add Stripe settings if they don't exist
INSERT INTO system_settings (key, value, category)
VALUES ('stripe_public_key', '', 'payment')
ON CONFLICT (key) DO NOTHING;

INSERT INTO system_settings (key, value, category)
VALUES ('stripe_secret_key', '', 'payment')
ON CONFLICT (key) DO NOTHING;

INSERT INTO system_settings (key, value, category)
VALUES ('stripe_webhook_secret', '', 'payment')
ON CONFLICT (key) DO NOTHING;

INSERT INTO system_settings (key, value, category)
VALUES ('stripe_enabled', 'false', 'payment')
ON CONFLICT (key) DO NOTHING;