Initial commit - ERP System

This commit is contained in:
root
2026-05-20 18:58:23 +00:00
commit e174936997
2697 changed files with 1628427 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
// /opt/erp-system/app/api/setup-customer/route.ts
import { NextResponse } from 'next/server';
import prisma from '../../../lib/prisma';
import bcrypt from 'bcryptjs';
export async function GET() {
try {
const customer = await prisma.customer.findFirst({ orderBy: { id: 'asc' } });
if (!customer) {
return NextResponse.json({ error: 'Kein Kunde im System gefunden.' }, { status: 404 });
}
const hash = await bcrypt.hash('portal123', 10);
await prisma.customer.update({
where: { id: customer.id },
data: { passwordHash: hash }
});
return NextResponse.json({
success: true,
message: `Passwort für Kunde ${customer.email} (ID: ${customer.id}) erfolgreich auf 'portal123' gesetzt.`
});
} catch (error) {
return NextResponse.json({ error: 'Fehler' }, { status: 500 });
}
}