import { PrismaClient } from '../src/generated/prisma';
import * as bcrypt from 'bcrypt';

const prisma = new PrismaClient();

async function createUser() {
  try {
    const hashedPassword = await bcrypt.hash('gk1510!', 10);
    
    const user = await prisma.user.create({
      data: {
        email: 'gregor@klevze.si',
        password: hashedPassword,
        name: 'Gregor',
        surname: 'Klevže',
        active: true,
        role: 'admin',
      },
    });

    console.log('User created successfully:', user);
  } catch (error) {
    console.error('Error creating user:', error);
  } finally {
    await prisma.$disconnect();
  }
}

createUser();