feat: Initialize core application structure including authentication, role-based dashboards, service task management, and integration workflows.
This commit is contained in:
42
app/Notifications/SlaOverdueNotification.php
Normal file
42
app/Notifications/SlaOverdueNotification.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Models\ServiceTask;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
class SlaOverdueNotification extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public function __construct(protected ServiceTask $serviceTask)
|
||||
{
|
||||
}
|
||||
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
return ['database', 'mail'];
|
||||
}
|
||||
|
||||
public function toMail(object $notifiable): array|MailMessage
|
||||
{
|
||||
return (new MailMessage)
|
||||
->error()
|
||||
->subject('ALERTE : SLA Dépassé')
|
||||
->line('Le délai SLA pour la tâche ' . $this->serviceTask->service->name . ' (Agent: ' . $this->serviceTask->integrationRequest->agent->first_name . ' ' . $this->serviceTask->integrationRequest->agent->last_name . ') est dépassé.')
|
||||
->action('Voir la tâche', route('integrations.show', $this->serviceTask->integrationRequest))
|
||||
->line('Merci d\'intervenir immédiatement.');
|
||||
}
|
||||
|
||||
public function toArray(object $notifiable): array
|
||||
{
|
||||
return [
|
||||
'service_task_id' => $this->serviceTask->id,
|
||||
'message' => 'SLA dépassé pour ' . $this->serviceTask->service->name,
|
||||
'type' => 'overdue',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user