feat(logging): migrate Education container to education channel
This commit is contained in:
@@ -38,21 +38,21 @@ class CreateAdmissionPlan implements ShouldQueue
|
|||||||
$items = $this->admissionPlanService->getCampaigns();
|
$items = $this->admissionPlanService->getCampaigns();
|
||||||
|
|
||||||
if (empty($items)) {
|
if (empty($items)) {
|
||||||
Log::warning('Empty campaigns list received');
|
Log::channel('education')->warning('Empty campaigns list received');
|
||||||
return; // или обработка пустого случая
|
return; // или обработка пустого случая
|
||||||
}
|
}
|
||||||
|
|
||||||
$campaign = $this->admissionPlanService->findActiveCampaign($items);
|
$campaign = $this->admissionPlanService->findActiveCampaign($items);
|
||||||
|
|
||||||
if (empty($campaign)) {
|
if (empty($campaign)) {
|
||||||
Log::warning('No active campaign found in the list');
|
Log::channel('education')->warning('No active campaign found in the list');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$levels_codes = $this->admissionPlanService->getLevelEducationCodes($campaign);
|
$levels_codes = $this->admissionPlanService->getLevelEducationCodes($campaign);
|
||||||
|
|
||||||
if (empty($levels_codes)) {
|
if (empty($levels_codes)) {
|
||||||
Log::warning('No education level codes found for campaign');
|
Log::channel('education')->warning('No education level codes found for campaign');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ class CreateAdmissionPlan implements ShouldQueue
|
|||||||
|
|
||||||
// Проверка на пустой результат или отсутствие нужного свойства
|
// Проверка на пустой результат или отсутствие нужного свойства
|
||||||
if (empty($admissionPlans) || !isset($admissionPlans->competitons_groups)) {
|
if (empty($admissionPlans) || !isset($admissionPlans->competitons_groups)) {
|
||||||
Log::warning("Empty admission plans or missing property for code: {$code}", [
|
Log::channel('education')->warning("Empty admission plans or missing property for code: {$code}", [
|
||||||
'admissionPlans' => $admissionPlans
|
'admissionPlans' => $admissionPlans
|
||||||
]);
|
]);
|
||||||
continue;
|
continue;
|
||||||
@@ -70,28 +70,28 @@ class CreateAdmissionPlan implements ShouldQueue
|
|||||||
$filteredPlans = $this->admissionPlanService->filterEmptyNaprOrProg($admissionPlans->competitons_groups);
|
$filteredPlans = $this->admissionPlanService->filterEmptyNaprOrProg($admissionPlans->competitons_groups);
|
||||||
|
|
||||||
if (empty($filteredPlans)) {
|
if (empty($filteredPlans)) {
|
||||||
Log::info("No valid plans after filtering for code: {$code}");
|
Log::channel('education')->info("No valid plans after filtering for code: {$code}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$items = $this->admissionPlanService->transformData($filteredPlans);
|
$items = $this->admissionPlanService->transformData($filteredPlans);
|
||||||
|
|
||||||
if (empty($items)) {
|
if (empty($items)) {
|
||||||
Log::info("No items after transformation for code: {$code}");
|
Log::channel('education')->info("No items after transformation for code: {$code}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
// Проверка структуры $item
|
// Проверка структуры $item
|
||||||
if (!isset($item['id'], $item['plan']->competitions, $item['plan']->exams)) {
|
if (!isset($item['id'], $item['plan']->competitions, $item['plan']->exams)) {
|
||||||
Log::warning("Invalid item structure", ['item' => $item]);
|
Log::channel('education')->warning("Invalid item structure", ['item' => $item]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$eduPrograms = EducationalProgram::where('inner_code', $item['id'])->get();
|
$eduPrograms = EducationalProgram::where('inner_code', $item['id'])->get();
|
||||||
|
|
||||||
if ($eduPrograms->isEmpty()) {
|
if ($eduPrograms->isEmpty()) {
|
||||||
Log::info("No educational programs found for inner_code: {$item['id']}");
|
Log::channel('education')->info("No educational programs found for inner_code: {$item['id']}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ class CreateAdmissionPlan implements ShouldQueue
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Log::error("Error processing admission plan for item: {$item['id']}", [
|
Log::channel('education')->error("Error processing admission plan for item: {$item['id']}", [
|
||||||
'error' => $e->getMessage(),
|
'error' => $e->getMessage(),
|
||||||
'item' => $item
|
'item' => $item
|
||||||
]);
|
]);
|
||||||
@@ -116,7 +116,7 @@ class CreateAdmissionPlan implements ShouldQueue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Log::error('Error in admission plans processing', [
|
Log::channel('education')->error('Error in admission plans processing', [
|
||||||
'error' => $e->getMessage(),
|
'error' => $e->getMessage(),
|
||||||
'trace' => $e->getTraceAsString()
|
'trace' => $e->getTraceAsString()
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class CreateEducationalProgram implements ShouldQueue
|
|||||||
if ($program !== null) {
|
if ($program !== null) {
|
||||||
array_push($programs, $program);
|
array_push($programs, $program);
|
||||||
} else {
|
} else {
|
||||||
Log::error("Не удалось получить данные о программе с UUID: $uuid");
|
Log::channel('education')->error('Failed to get program data by UUID', ['uuid' => $uuid]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ class CreateEducationalProgram implements ShouldQueue
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
Log::error("Не удалось найти направление обучения с UUID: {$program->napr_uuid}");
|
Log::channel('education')->error('Direction study not found', ['uuid' => $program->napr_uuid]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,21 +38,21 @@ class CreateAdmissionPlan implements ShouldQueue
|
|||||||
$items = $this->admissionPlanService->getCampaigns();
|
$items = $this->admissionPlanService->getCampaigns();
|
||||||
|
|
||||||
if (empty($items)) {
|
if (empty($items)) {
|
||||||
Log::warning('Empty campaigns list received');
|
Log::channel('education')->warning('Empty campaigns list received');
|
||||||
return; // или обработка пустого случая
|
return; // или обработка пустого случая
|
||||||
}
|
}
|
||||||
|
|
||||||
$campaign = $this->admissionPlanService->findActiveCampaign($items);
|
$campaign = $this->admissionPlanService->findActiveCampaign($items);
|
||||||
|
|
||||||
if (empty($campaign)) {
|
if (empty($campaign)) {
|
||||||
Log::warning('No active campaign found in the list');
|
Log::channel('education')->warning('No active campaign found in the list');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$levels_codes = $this->admissionPlanService->getLevelEducationCodes($campaign);
|
$levels_codes = $this->admissionPlanService->getLevelEducationCodes($campaign);
|
||||||
|
|
||||||
if (empty($levels_codes)) {
|
if (empty($levels_codes)) {
|
||||||
Log::warning('No education level codes found for campaign');
|
Log::channel('education')->warning('No education level codes found for campaign');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ class CreateAdmissionPlan implements ShouldQueue
|
|||||||
|
|
||||||
// Проверка на пустой результат или отсутствие нужного свойства
|
// Проверка на пустой результат или отсутствие нужного свойства
|
||||||
if (empty($admissionPlans) || !isset($admissionPlans->competitons_groups)) {
|
if (empty($admissionPlans) || !isset($admissionPlans->competitons_groups)) {
|
||||||
Log::warning("Empty admission plans or missing property for code: {$code}", [
|
Log::channel('education')->warning("Empty admission plans or missing property for code: {$code}", [
|
||||||
'admissionPlans' => $admissionPlans
|
'admissionPlans' => $admissionPlans
|
||||||
]);
|
]);
|
||||||
continue;
|
continue;
|
||||||
@@ -70,28 +70,28 @@ class CreateAdmissionPlan implements ShouldQueue
|
|||||||
$filteredPlans = $this->admissionPlanService->filterEmptyNaprOrProg($admissionPlans->competitons_groups);
|
$filteredPlans = $this->admissionPlanService->filterEmptyNaprOrProg($admissionPlans->competitons_groups);
|
||||||
|
|
||||||
if (empty($filteredPlans)) {
|
if (empty($filteredPlans)) {
|
||||||
Log::info("No valid plans after filtering for code: {$code}");
|
Log::channel('education')->info("No valid plans after filtering for code: {$code}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$items = $this->admissionPlanService->transformData($filteredPlans);
|
$items = $this->admissionPlanService->transformData($filteredPlans);
|
||||||
|
|
||||||
if (empty($items)) {
|
if (empty($items)) {
|
||||||
Log::info("No items after transformation for code: {$code}");
|
Log::channel('education')->info("No items after transformation for code: {$code}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
// Проверка структуры $item
|
// Проверка структуры $item
|
||||||
if (!isset($item['id'], $item['plan']->competitions, $item['plan']->exams)) {
|
if (!isset($item['id'], $item['plan']->competitions, $item['plan']->exams)) {
|
||||||
Log::warning("Invalid item structure", ['item' => $item]);
|
Log::channel('education')->warning("Invalid item structure", ['item' => $item]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$eduPrograms = EducationalProgram::where('inner_code', $item['id'])->get();
|
$eduPrograms = EducationalProgram::where('inner_code', $item['id'])->get();
|
||||||
|
|
||||||
if ($eduPrograms->isEmpty()) {
|
if ($eduPrograms->isEmpty()) {
|
||||||
Log::info("No educational programs found for inner_code: {$item['id']}");
|
Log::channel('education')->info("No educational programs found for inner_code: {$item['id']}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ class CreateAdmissionPlan implements ShouldQueue
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Log::error("Error processing admission plan for item: {$item['id']}", [
|
Log::channel('education')->error("Error processing admission plan for item: {$item['id']}", [
|
||||||
'error' => $e->getMessage(),
|
'error' => $e->getMessage(),
|
||||||
'item' => $item
|
'item' => $item
|
||||||
]);
|
]);
|
||||||
@@ -116,7 +116,7 @@ class CreateAdmissionPlan implements ShouldQueue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Log::error('Error in admission plans processing', [
|
Log::channel('education')->error('Error in admission plans processing', [
|
||||||
'error' => $e->getMessage(),
|
'error' => $e->getMessage(),
|
||||||
'trace' => $e->getTraceAsString()
|
'trace' => $e->getTraceAsString()
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class CreateEducationalProgram implements ShouldQueue
|
|||||||
if ($program !== null) {
|
if ($program !== null) {
|
||||||
array_push($programs, $program);
|
array_push($programs, $program);
|
||||||
} else {
|
} else {
|
||||||
Log::error("Не удалось получить данные о программе с UUID: $uuid");
|
Log::channel('education')->error('Failed to get program data by UUID', ['uuid' => $uuid]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ class CreateEducationalProgram implements ShouldQueue
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
Log::error("Не удалось найти направление обучения с UUID: {$program->napr_uuid}");
|
Log::channel('education')->error('Direction study not found', ['uuid' => $program->napr_uuid]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user