command?->info('코어 알림 정의 시딩 시작...'); $helper = app(NotificationSyncHelper::class); // config/core.php::notification_definitions + 언어팩 seed/notifications.json 병합 $definitions = $this->loadConfigSeed('core.notification_definitions', 'seed.notifications.translations'); $definedTypes = []; if (empty($definitions)) { $this->command?->warn('config/core.php 에 notification_definitions 선언이 없습니다.'); return; } foreach ($definitions as $type => $data) { $data = array_merge($data, [ 'type' => $type, 'extension_type' => 'core', 'extension_identifier' => 'core', ]); $definition = $helper->syncDefinition($data); $definedTypes[] = $definition->type; $definedChannels = []; foreach ($data['templates'] ?? [] as $template) { $helper->syncTemplate($definition->id, $template); $definedChannels[] = $template['channel']; } // 완전 동기화: config 에서 제거된 channel 의 template 삭제 $helper->cleanupStaleTemplates($definition->id, $definedChannels); $this->command?->info(" - {$type} 알림 정의 등록 완료"); } // 완전 동기화: config 에서 제거된 코어 definition 삭제 (cascade 로 template 도 정리) $removed = $helper->cleanupStaleDefinitions('core', 'core', $definedTypes); if ($removed > 0) { $this->command?->line(" - stale 정의 {$removed}개 정리"); } $this->command?->info('코어 알림 정의 시딩 완료 ('.count($definedTypes).'종)'); } }