Integração com Telegram

This commit is contained in:
Halbe Bruno
2025-12-05 21:20:31 -03:00
parent 1e761ea3d8
commit 81dd696d0b
8 changed files with 409 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Controllers;
use App\Models\Order;
use App\Services\OrderProcessor;
use App\Services\TelegramService;
use App\Utils\View;
class OrderController
@@ -99,6 +100,16 @@ class OrderController
$processor = new OrderProcessor();
$count = $processor->process($orderId, $type, $_FILES['csv_file']['tmp_name']);
// Send Telegram Notification
$telegramService = new TelegramService();
$typeLabel = ($type === 'block') ? 'Bloqueio' : (($type === 'unblock') ? 'Desbloqueio' : $type);
$telegramService->sendOrderNotification([
'id' => $orderId,
'title' => $title,
'type' => $typeLabel
], $count);
$_SESSION['flash_success'] = "Ordem criada com sucesso! $count domínios processados.";
View::redirect('/admin/orders');