merge: integrate Alexis latest changes

This commit is contained in:
2026-08-17 11:46:41 +00:00
60 changed files with 5959 additions and 686 deletions

View File

@@ -0,0 +1,39 @@
const bcrypt = require('bcrypt')
const prisma = require('../config/prisma')
async function createAdmin() {
const email = 'admin@thetiptop.fr'
const password = 'Admin@TipTop2026!'
const existing = await prisma.user.findUnique({ where: { email } })
if (existing) {
await prisma.user.update({
where: { email },
data: { isEmailVerified: true, role: 'ADMIN' },
})
console.log('Admin mis à jour :', email)
return
}
const hashed = await bcrypt.hash(password, 10)
await prisma.user.create({
data: {
firstname: 'Admin',
lastname: 'TipTop',
email,
password: hashed,
role: 'ADMIN',
isEmailVerified: true,
},
})
console.log('Admin créé avec succès')
console.log(' Email :', email)
console.log(' Mot de passe:', password)
}
createAdmin()
.catch((e) => { console.error('Erreur :', e.message); process.exit(1) })
.finally(() => prisma.$disconnect())