27 lines
682 B
TypeScript
27 lines
682 B
TypeScript
import { PrismaClient, UserRole } from '@prisma/client';
|
|
|
|
export async function seedRoles(prisma: PrismaClient): Promise<void> {
|
|
// eslint-disable-next-line no-console
|
|
console.log(' -> Seeding baseline users & roles...');
|
|
|
|
await prisma.user.upsert({
|
|
where: { email: 'admin@supporthub.internal' },
|
|
update: {},
|
|
create: {
|
|
email: 'admin@supporthub.internal',
|
|
name: 'System Admin',
|
|
role: UserRole.ADMIN,
|
|
},
|
|
});
|
|
|
|
await prisma.user.upsert({
|
|
where: { email: 'agent@supporthub.internal' },
|
|
update: {},
|
|
create: {
|
|
email: 'agent@supporthub.internal',
|
|
name: 'Default Support Agent',
|
|
role: UserRole.AGENT,
|
|
},
|
|
});
|
|
}
|