#!/bin/bash

echo "Fixing permissions for supabase/functions directory..."
sudo chown -R $(whoami):$(whoami) supabase/functions/

echo "Creating function directories..."
mkdir -p supabase/functions/auth
mkdir -p supabase/functions/shopify-oauth
mkdir -p supabase/functions/woocommerce-oauth
mkdir -p supabase/functions/gdpr-webhooks

echo "Note: You'll need to manually create the function files or I can help with that next."
echo ""
echo "After creating the files, deploy with:"
echo "./node_modules/.bin/supabase functions deploy auth --no-verify-jwt"
echo "./node_modules/.bin/supabase functions deploy shopify-oauth --no-verify-jwt"
echo "./node_modules/.bin/supabase functions deploy woocommerce-oauth --no-verify-jwt"
echo "./node_modules/.bin/supabase functions deploy gdpr-webhooks --no-verify-jwt"
