feat: Initialize core application structure including authentication, role-based dashboards, service task management, and integration workflows.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?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 ServiceTaskReadyForValidationNotification extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public function __construct(public ServiceTask $serviceTask)
|
||||
{
|
||||
}
|
||||
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
return ['database', 'mail'];
|
||||
}
|
||||
|
||||
public function toMail(object $notifiable): MailMessage
|
||||
{
|
||||
$serviceName = $this->serviceTask->service->name;
|
||||
$agentName = $this->serviceTask->integrationRequest->agent->first_name . ' ' . $this->serviceTask->integrationRequest->agent->last_name;
|
||||
|
||||
return (new MailMessage)
|
||||
->subject("Validation requise : {$serviceName} - {$agentName}")
|
||||
->greeting("Bonjour {$notifiable->name},")
|
||||
->line("Toutes les tâches obligatoires pour le service **{$serviceName}** concernant l'agent **{$agentName}** ont été effectuées.")
|
||||
->line("Merci de vérifier et de valider la tâche.")
|
||||
->action('Valider la tâche', route('integrations.show', $this->serviceTask->integrationRequest));
|
||||
}
|
||||
|
||||
public function toArray(object $notifiable): array
|
||||
{
|
||||
return [
|
||||
'service_task_id' => $this->serviceTask->id,
|
||||
'integration_request_id' => $this->serviceTask->integration_request_id,
|
||||
'message' => "Tâche prête pour validation.",
|
||||
'type' => 'task_ready_validation',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user