-- Add INSERT policy for provider_wallets
-- This allows the register_provider function to create wallets

-- Add INSERT policy for providers
CREATE POLICY "Providers can insert own wallet"
  ON provider_wallets
  FOR INSERT
  TO public
  WITH CHECK (auth.uid() = provider_id);

-- Also add UPDATE policy for future use
CREATE POLICY "Providers can update own wallet"
  ON provider_wallets
  FOR UPDATE
  TO public
  USING (auth.uid() = provider_id)
  WITH CHECK (auth.uid() = provider_id);