import { prisma } from '../lib/prisma'; async function main() { console.log('🗑️ Lösche alte LexOffice IDs für erneuten Test...\n'); const booking = await prisma.booking.findFirst({ where: { bookingNumber: 'STM-2511-9237' }, }); if (!booking) { console.log('❌ Buchung nicht gefunden'); return; } console.log('📋 Buchung:', booking.bookingNumber); console.log('🆔 Aktuelle LexOffice Offer ID:', booking.lexofficeOfferId); if (booking.lexofficeOfferId) { await prisma.booking.update({ where: { id: booking.id }, data: { lexofficeOfferId: null, lexofficeContactId: null, }, }); console.log('\n✅ LexOffice IDs gelöscht!'); console.log('ℹ️ Der "Automation starten" Button sollte jetzt wieder erscheinen.'); console.log('⚠️ WICHTIG: Lösche die alte Quotation in LexOffice manuell (AN-221646)'); } else { console.log('\n✅ Keine LexOffice IDs vorhanden - nichts zu löschen.'); } } main() .catch((e) => { console.error(e); process.exit(1); }) .finally(async () => { await prisma.$disconnect(); });