74 lines
1.8 KiB
PHP
74 lines
1.8 KiB
PHP
<?php
|
||
|
||
namespace App\Services\LineListTriggers\Triggers;
|
||
|
||
use App\Services\LineListTriggers\Base\BaseLineListTrigger;
|
||
use Illuminate\Support\Facades\Log;
|
||
|
||
/**
|
||
* Cleanup Operations Trigger
|
||
*
|
||
* Non-critical cleanup operations at the end
|
||
* Deletes orphaned paint follow up records
|
||
*/
|
||
class CleanupOperationsTrigger extends BaseLineListTrigger
|
||
{
|
||
public function getName(): string
|
||
{
|
||
return 'Cleanup Operations';
|
||
}
|
||
|
||
public function getDependentFields(): array
|
||
{
|
||
return ['line_no', 'painting_cycle'];
|
||
}
|
||
|
||
protected function process($lineListData, $beforeData, array $context): array
|
||
{
|
||
|
||
|
||
|
||
|
||
/*
|
||
|
||
try {
|
||
// Clean-up operation - delete no paint followup
|
||
view('cron.delete-no-paint-followup', [
|
||
'lineNumber' => $lineListData->line_no
|
||
])->render();
|
||
|
||
Log::debug("Cleanup operations completed", [
|
||
'line_no' => $lineListData->line_no
|
||
]);
|
||
|
||
Log::debug("Cleanup operations completed", [
|
||
'line_no' => $lineListData->line_no,
|
||
'before_painting_cycle' => $beforeData->painting_cycle
|
||
]);
|
||
|
||
|
||
return [
|
||
'success' => true,
|
||
'executed' => 'cleanup_view'
|
||
];
|
||
} catch (\Exception $cleanupException) {
|
||
Log::warning("Clean-up işlemi başarısız oldu: " . $cleanupException->getMessage(), [
|
||
'line_number' => $lineListData->line_no
|
||
]);
|
||
|
||
// Non-critical, don't throw
|
||
return [
|
||
'success' => false,
|
||
'error' => $cleanupException->getMessage(),
|
||
'note' => 'non_critical'
|
||
];
|
||
}
|
||
*/
|
||
|
||
|
||
|
||
}
|
||
}
|
||
|
||
|