Update seed: real admin accounts, remove all dummy data
Build and Push Docker Image / build (push) Successful in 4m3s
Details
Build and Push Docker Image / build (push) Successful in 4m3s
Details
- Add matt@monaco-opc.com and admin@monaco-opc.com as SUPER_ADMIN with passwords - Remove dummy jury members (jury1-3@example.com) - Remove dummy sample projects - Keep system settings, program, round, and evaluation form Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bfcfd84008
commit
a020d13c00
124
prisma/seed.ts
124
prisma/seed.ts
|
|
@ -7,6 +7,7 @@ import {
|
|||
SettingType,
|
||||
SettingCategory,
|
||||
} from '@prisma/client'
|
||||
import bcrypt from 'bcryptjs'
|
||||
|
||||
const prisma = new PrismaClient()
|
||||
|
||||
|
|
@ -244,22 +245,41 @@ async function main() {
|
|||
}
|
||||
|
||||
// ==========================================================================
|
||||
// Create Super Admin
|
||||
// Create Admin Users
|
||||
// ==========================================================================
|
||||
console.log('👤 Creating super admin...')
|
||||
console.log('👤 Creating admin users...')
|
||||
|
||||
const admin = await prisma.user.upsert({
|
||||
where: { email: 'matt.ciaccio@gmail.com' },
|
||||
update: {},
|
||||
const adminAccounts = [
|
||||
{
|
||||
email: 'matt@monaco-opc.com',
|
||||
name: 'Matt',
|
||||
password: '195260Mp!',
|
||||
},
|
||||
{
|
||||
email: 'admin@monaco-opc.com',
|
||||
name: 'Admin',
|
||||
password: 'XDvVSDkPJKDXozlx',
|
||||
},
|
||||
]
|
||||
|
||||
for (const account of adminAccounts) {
|
||||
const passwordHash = await bcrypt.hash(account.password, 12)
|
||||
const user = await prisma.user.upsert({
|
||||
where: { email: account.email },
|
||||
update: { passwordHash },
|
||||
create: {
|
||||
email: 'matt.ciaccio@gmail.com',
|
||||
name: 'Matt Ciaccio',
|
||||
email: account.email,
|
||||
name: account.name,
|
||||
role: UserRole.SUPER_ADMIN,
|
||||
status: UserStatus.ACTIVE,
|
||||
passwordHash,
|
||||
mustSetPassword: false,
|
||||
passwordSetAt: new Date(),
|
||||
onboardingCompletedAt: new Date(),
|
||||
},
|
||||
})
|
||||
|
||||
console.log(` Created admin: ${admin.email}`)
|
||||
console.log(` Created admin: ${user.email}`)
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
// Create Sample Program
|
||||
|
|
@ -393,89 +413,15 @@ async function main() {
|
|||
|
||||
console.log(' Created evaluation form v1')
|
||||
|
||||
// ==========================================================================
|
||||
// Create Sample Jury Members
|
||||
// ==========================================================================
|
||||
console.log('👥 Creating sample jury members...')
|
||||
|
||||
const juryMembers = [
|
||||
{
|
||||
email: 'jury1@example.com',
|
||||
name: 'Dr. Marine Expert',
|
||||
expertiseTags: ['marine_biology', 'conservation', 'policy'],
|
||||
},
|
||||
{
|
||||
email: 'jury2@example.com',
|
||||
name: 'Tech Innovator',
|
||||
expertiseTags: ['technology', 'innovation', 'startups'],
|
||||
},
|
||||
{
|
||||
email: 'jury3@example.com',
|
||||
name: 'Ocean Advocate',
|
||||
expertiseTags: ['conservation', 'sustainability', 'education'],
|
||||
},
|
||||
]
|
||||
|
||||
for (const jury of juryMembers) {
|
||||
await prisma.user.upsert({
|
||||
where: { email: jury.email },
|
||||
update: {},
|
||||
create: {
|
||||
email: jury.email,
|
||||
name: jury.name,
|
||||
role: UserRole.JURY_MEMBER,
|
||||
status: UserStatus.INVITED,
|
||||
expertiseTags: jury.expertiseTags,
|
||||
maxAssignments: 15,
|
||||
},
|
||||
})
|
||||
console.log(` Created jury member: ${jury.email}`)
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
// Create Sample Projects
|
||||
// ==========================================================================
|
||||
console.log('📦 Creating sample projects...')
|
||||
|
||||
const sampleProjects = [
|
||||
{
|
||||
title: 'OceanAI - Plastic Detection System',
|
||||
teamName: 'BlueWave Tech',
|
||||
description: 'AI-powered system using satellite imagery and drones to detect and map ocean plastic concentrations for targeted cleanup operations.',
|
||||
tags: ['technology', 'ai', 'plastic_pollution'],
|
||||
},
|
||||
{
|
||||
title: 'Coral Restoration Network',
|
||||
teamName: 'ReefGuard Foundation',
|
||||
description: 'Community-driven coral nursery and transplantation program using innovative 3D-printed substrates.',
|
||||
tags: ['conservation', 'coral', 'community'],
|
||||
},
|
||||
{
|
||||
title: 'SeaTrack - Sustainable Fishing Tracker',
|
||||
teamName: 'FishRight Solutions',
|
||||
description: 'Blockchain-based supply chain tracking system ensuring sustainable fishing practices from ocean to table.',
|
||||
tags: ['technology', 'sustainable_fishing', 'blockchain'],
|
||||
},
|
||||
]
|
||||
|
||||
for (const project of sampleProjects) {
|
||||
await prisma.project.create({
|
||||
data: {
|
||||
roundId: round1.id,
|
||||
title: project.title,
|
||||
teamName: project.teamName,
|
||||
description: project.description,
|
||||
tags: project.tags,
|
||||
},
|
||||
})
|
||||
console.log(` Created project: ${project.title}`)
|
||||
}
|
||||
|
||||
console.log('')
|
||||
console.log('✅ Seeding completed successfully!')
|
||||
console.log('')
|
||||
console.log('📧 Admin login: matt.ciaccio@gmail.com')
|
||||
console.log(' (Use magic link authentication)')
|
||||
console.log('Admin accounts:')
|
||||
for (const account of adminAccounts) {
|
||||
console.log(` ${account.email}`)
|
||||
}
|
||||
console.log('')
|
||||
console.log('Next: run seed-candidatures.ts to import real participant data')
|
||||
}
|
||||
|
||||
main()
|
||||
|
|
|
|||
Loading…
Reference in New Issue