import { randomUUID } from 'crypto'; import { PrismaClient, UserRole } from '@prisma/client'; import bcrypt from 'bcryptjs'; export async function seedDemoData(prisma: PrismaClient): Promise { // eslint-disable-next-line no-console console.log(' -> Seeding demo environment data...'); // Legacy demo row, pre-existing since before 010-identity-auth: a CUSTOMER-role User is // never a real login identity (customer identity is exclusively SaaS-delegated, see // specs/010-identity-auth/spec.md Assumptions) — passwordHash is populated only to satisfy // the column's NOT NULL constraint; this account can never authenticate via /auth/login. await prisma.user.upsert({ where: { email: 'john.doe@example.com' }, update: {}, create: { email: 'john.doe@example.com', name: 'John Doe (Demo Customer)', role: UserRole.CUSTOMER, passwordHash: await bcrypt.hash(randomUUID(), 10), }, }); }