- Create AnsibleDeployStage using framework's Process module for secure command execution - Integrate AnsibleDeployStage into DeploymentPipelineCommands for production deployments - Add force_deploy flag support in Ansible playbook to override stale locks - Use PHP deployment module as orchestrator (php console.php deploy:production) - Fix ErrorAggregationInitializer to use Environment class instead of $_ENV superglobal Architecture: - BuildStage → AnsibleDeployStage → HealthCheckStage for production - Process module provides timeout, error handling, and output capture - Ansible playbook supports rollback via rollback-git-based.yml - Zero-downtime deployments with health checks
42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Framework\Notification\Channels\Telegram\Webhook\Examples;
|
|
|
|
use App\Framework\Notification\Channels\Telegram\Webhook\{CallbackHandler, CallbackResponse, TelegramCallbackQuery};
|
|
|
|
/**
|
|
* Example Callback Handler: Reject Order
|
|
*
|
|
* Demonstrates callback handler with alert popup
|
|
*
|
|
* Usage in button:
|
|
* InlineKeyboardButton::withCallback('❌ Reject', 'reject_order_123')
|
|
*/
|
|
final readonly class RejectOrderHandler implements CallbackHandler
|
|
{
|
|
public function getCommand(): string
|
|
{
|
|
return 'reject_order';
|
|
}
|
|
|
|
public function handle(TelegramCallbackQuery $callbackQuery): CallbackResponse
|
|
{
|
|
$orderId = $callbackQuery->getParameter();
|
|
|
|
if ($orderId === null) {
|
|
return CallbackResponse::alert('Invalid order ID');
|
|
}
|
|
|
|
// TODO: Implement actual order rejection logic
|
|
// $this->orderService->reject($orderId);
|
|
|
|
// Return alert popup with message edit
|
|
return CallbackResponse::withEdit(
|
|
text: "Order #{$orderId} has been rejected",
|
|
newMessage: "Order #{$orderId}\n\nStatus: ❌ *Rejected*\nRejected by: User {$callbackQuery->fromUserId}"
|
|
);
|
|
}
|
|
}
|