Files
Atlas/scripts/configure-luebeck-km.ts
Julia Wehden a2c95c70e7 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
2026-03-19 16:21:55 +01:00

78 lines
2.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function configureLuebeckLocation() {
console.log('🔧 Konfiguriere Lübeck Location & Kilometerpauschalen...\n');
try {
const location = await prisma.location.findUnique({
where: { slug: 'luebeck' },
});
if (!location) {
console.error('❌ Lübeck Location nicht gefunden!');
process.exit(1);
}
await prisma.location.update({
where: { id: location.id },
data: {
warehouseAddress: 'Wahmstraße 83',
warehouseZip: '23552',
warehouseCity: 'Lübeck',
},
});
console.log('✅ Lager-Adresse gesetzt: Wahmstraße 83, 23552 Lübeck\n');
const models = ['VINTAGE_SMILE', 'VINTAGE_PHOTOS', 'NOSTALGIE', 'MAGIC_MIRROR'];
for (const model of models) {
const existing = await prisma.priceConfig.findUnique({
where: {
locationId_model: {
locationId: location.id,
model: model as any,
},
},
});
if (existing) {
await prisma.priceConfig.update({
where: {
locationId_model: {
locationId: location.id,
model: model as any,
},
},
data: {
kmFlatRate: 60.0,
kmFlatRateUpTo: 15,
pricePerKm: 0.40,
kmMultiplier: 4,
},
});
console.log(`${model}: Kilometerpauschale aktualisiert`);
} else {
console.log(`⚠️ ${model}: Keine PriceConfig gefunden, überspringe...`);
}
}
console.log('\n🎉 Lübeck Location erfolgreich konfiguriert!');
console.log('\nKonfiguration:');
console.log(' 📍 Lager: Wahmstraße 83, 23552 Lübeck');
console.log(' 💰 Pauschale bis 15km: 60,00€ brutto');
console.log(' 💰 Darüber: 0,40€ netto/km × 4 Strecken');
} catch (error) {
console.error('❌ Fehler:', error);
throw error;
} finally {
await prisma.$disconnect();
}
}
configureLuebeckLocation();