feat: add error handling to player creation and update gitignore for agent

This commit is contained in:
Erik Silva
2026-01-24 14:18:40 -03:00
commit 416bd83ea7
93 changed files with 16861 additions and 0 deletions

47
prisma/seed.ts Normal file
View File

@@ -0,0 +1,47 @@
import { PrismaClient } from '@prisma/client'
import bcrypt from 'bcryptjs'
const prisma = new PrismaClient()
async function main() {
const password = await bcrypt.hash('Android@2020', 12)
// 1. Criar Admin
await prisma.admin.upsert({
where: { email: 'admin@temfut.com' },
update: {},
create: {
email: 'admin@temfut.com',
name: 'Super Admin',
password: password,
role: 'SUPER_ADMIN'
}
})
// 2. Criar Pelada de Exemplo
await prisma.group.upsert({
where: { email: 'erik@idealpages.com.br' },
update: {},
create: {
name: 'Fut de Quarta',
slug: 'futdequarta',
email: 'erik@idealpages.com.br',
password: password,
status: 'ACTIVE',
plan: 'PRO',
primaryColor: '#10b981',
secondaryColor: '#000000'
}
})
console.log('Seed concluído com sucesso!')
}
main()
.catch((e) => {
console.error(e)
process.exit(1)
})
.finally(async () => {
await prisma.$disconnect()
})