#!/bin/bash

# Script pour remplacer "session" par "sequence" dans les fichiers frontend

cd /home/ubuntu/formation-manager-itinova

# Remplacements dans les fichiers TypeScript/TSX
find client/src -type f \( -name "*.ts" -o -name "*.tsx" \) -exec sed -i \
  -e 's/\bsessions\b/sequences/g' \
  -e 's/\bsession\b/sequence/g' \
  -e 's/\bSession\b/Sequence/g' \
  -e 's/\bSESSION\b/SEQUENCE/g' \
  -e 's/sessionId/sequenceId/g' \
  -e 's/SessionId/SequenceId/g' \
  -e 's/sessionNom/sequenceNom/g' \
  -e 's/SessionNom/SequenceNom/g' \
  -e 's/AdminSequences/AdminSequences/g' \
  -e 's/AdminSequenceInscrits/AdminSequenceInscrits/g' \
  {} \;

echo "Migration terminée !"
