shiftplans shown correctly

This commit is contained in:
2025-10-11 01:26:06 +02:00
parent 4875f13321
commit eb49c58b2d
6 changed files with 73 additions and 41 deletions

View File

@@ -1,7 +1,7 @@
// backend/src/scripts/setupDefaultTemplate.ts
import { v4 as uuidv4 } from 'uuid';
import { db } from '../services/databaseService.js';
import { DEFAULT_TIME_SLOTS } from '../models/ShiftTemplate.js';
import { DEFAULT_TIME_SLOTS, TemplateShift } from '../models/ShiftTemplate.js';
interface AdminUser {
id: string;
@@ -95,6 +95,19 @@ export async function setupDefaultTemplate(): Promise<void> {
console.log('✅ Schichten erstellt');
// In der problematischen Stelle:
const createdTemplate = await db.get(
'SELECT * FROM shift_templates WHERE id = ?',
[templateId]
) as { name: string } | undefined;
console.log('📋 Erstellte Vorlage:', createdTemplate?.name);
const shiftCount = await db.get(
'SELECT COUNT(*) as count FROM template_shifts WHERE template_id = ?',
[templateId]
) as { count: number } | undefined;
console.log(`📊 Anzahl Schichten: ${shiftCount?.count}`);
await db.run('COMMIT');
console.log('🎉 Standard-Vorlage erfolgreich initialisiert');