- Move 12 markdown files from root to docs/ subdirectories - Organize documentation by category: • docs/troubleshooting/ (1 file) - Technical troubleshooting guides • docs/deployment/ (4 files) - Deployment and security documentation • docs/guides/ (3 files) - Feature-specific guides • docs/planning/ (4 files) - Planning and improvement proposals Root directory cleanup: - Reduced from 16 to 4 markdown files in root - Only essential project files remain: • CLAUDE.md (AI instructions) • README.md (Main project readme) • CLEANUP_PLAN.md (Current cleanup plan) • SRC_STRUCTURE_IMPROVEMENTS.md (Structure improvements) This improves: ✅ Documentation discoverability ✅ Logical organization by purpose ✅ Clean root directory ✅ Better maintainability
45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Framework\Notification\Jobs;
|
|
|
|
use App\Framework\Notification\Notification;
|
|
use App\Framework\Notification\NotificationDispatcher;
|
|
|
|
/**
|
|
* Queue job for asynchronous notification sending
|
|
*/
|
|
final readonly class SendNotificationJob
|
|
{
|
|
public function __construct(
|
|
public Notification $notification
|
|
) {
|
|
}
|
|
|
|
/**
|
|
* Execute the job
|
|
*
|
|
* @param NotificationDispatcher $dispatcher Injected by container
|
|
* @return array Result metadata
|
|
*/
|
|
public function handle(NotificationDispatcher $dispatcher): array
|
|
{
|
|
$result = $dispatcher->sendNow($this->notification);
|
|
|
|
return [
|
|
'notification_id' => $this->notification->id->toString(),
|
|
'recipient_id' => $this->notification->recipient_id,
|
|
'success' => $result->isSuccess(),
|
|
'channels_succeeded' => count($result->getSuccessful()),
|
|
'channels_failed' => count($result->getFailed()),
|
|
'errors' => $result->getErrors(),
|
|
];
|
|
}
|
|
|
|
public function getType(): string
|
|
{
|
|
return 'notification.send';
|
|
}
|
|
}
|