feat: Equipment-System, Buchungsbearbeitung, Kundenadresse, LexOffice-Fix

- Vintage Modell hinzugefuegt
- Equipment Multi-Select (Neue Buchung + Bearbeitung)
- Kundenadresse in Formularen
- Bearbeiten-Seite fuer Buchungen
- Abbau-Zeiten in Formularen und Uebersicht
- Vertrag PDF nur bei Privatkunden
- LexOffice Kontakt-Erstellung Fix (BUSINESS)
- Zurueck-Pfeil auf Touren-Seite
This commit is contained in:
Julia Wehden
2026-03-19 16:21:55 +01:00
parent 0b6e429329
commit a2c95c70e7
79 changed files with 7396 additions and 538 deletions

View File

@@ -0,0 +1,73 @@
import { config } from 'dotenv';
config(); // Load .env file
import { PrismaClient } from '@prisma/client';
import { nextcloudCalendar } from '../lib/nextcloud-calendar.ts';
const prisma = new PrismaClient();
async function syncExistingBookings() {
console.log('🔄 Synchronisiere bestehende Buchungen mit Nextcloud...\n');
try {
// Hole alle bestätigten Buchungen
const bookings = await prisma.booking.findMany({
where: {
status: {
in: ['RESERVED', 'CONFIRMED'],
},
},
include: {
location: true,
photobox: true,
},
orderBy: {
eventDate: 'asc',
},
});
console.log(`📊 Gefunden: ${bookings.length} Buchungen\n`);
if (bookings.length === 0) {
console.log(' Keine Buchungen zum Synchronisieren gefunden.');
return;
}
let synced = 0;
let failed = 0;
for (const booking of bookings) {
try {
console.log(`📅 Synchronisiere: ${booking.bookingNumber} - ${booking.customerName}`);
console.log(` Event: ${new Date(booking.eventDate).toLocaleDateString('de-DE')}`);
console.log(` Standort: ${booking.location?.name || 'Unbekannt'}`);
await nextcloudCalendar.syncBookingToCalendar(booking);
synced++;
console.log(` ✅ Erfolgreich!\n`);
} catch (error: any) {
failed++;
console.error(` ❌ Fehler: ${error.message}\n`);
}
}
console.log('─'.repeat(50));
console.log(`✅ Erfolgreich synchronisiert: ${synced}`);
console.log(`❌ Fehlgeschlagen: ${failed}`);
console.log(`📊 Gesamt: ${bookings.length}`);
console.log('\n🎉 Synchronisation abgeschlossen!');
console.log(' Prüfen Sie Nextcloud → Kalender "Buchungen (Dennis Forte)"');
} catch (error: any) {
console.error('❌ Fehler beim Synchronisieren:', error);
throw error;
} finally {
await prisma.$disconnect();
}
}
syncExistingBookings()
.catch((error) => {
console.error('Fatal error:', error);
process.exit(1);
});