/**
 * Script de nettoyage des pages admin non nécessaires
 */

const fs = require('fs');
const path = require('path');

const pagesToDelete = [
  // Pages non demandées
  'app/admin/utilisateurs/[id]',
  'app/admin/campagnes',
  'app/admin/remises',
  'app/admin/emailing',
  'app/admin/statistiques',

  // Pages de test/diagnostic
  'app/admin/test-tickets',
  'app/admin/test-simple',
  'app/admin/check-auth',
  'app/admin/diagnostic',
  'app/admin/create-test-tickets',
];

console.log('🧹 Nettoyage des pages admin non nécessaires...\n');

let deleted = 0;
let notFound = 0;

pagesToDelete.forEach(pagePath => {
  const fullPath = path.join(__dirname, '..', pagePath);

  try {
    if (fs.existsSync(fullPath)) {
      fs.rmSync(fullPath, { recursive: true, force: true });
      console.log(`✅ Supprimé: ${pagePath}`);
      deleted++;
    } else {
      console.log(`⚠️  N'existe pas: ${pagePath}`);
      notFound++;
    }
  } catch (error) {
    console.error(`❌ Erreur lors de la suppression de ${pagePath}:`, error.message);
  }
});

console.log(`\n📊 Résumé:`);
console.log(`  • Pages supprimées: ${deleted}`);
console.log(`  • Pages non trouvées: ${notFound}`);
console.log(`  • Total traité: ${pagesToDelete.length}`);
console.log('\n✨ Nettoyage terminé!');
