complete story 4.7 with qa tests

This commit is contained in:
Naser Mansour
2025-12-27 01:15:49 +02:00
parent 68a5551006
commit 4a0c98b134
7 changed files with 418 additions and 22 deletions
@@ -16,7 +16,7 @@ class TimelineUpdateNotification extends Notification implements ShouldQueue
* Create a new notification instance.
*/
public function __construct(
public TimelineUpdate $timelineUpdate
public TimelineUpdate $update
) {}
/**
@@ -35,13 +35,13 @@ class TimelineUpdateNotification extends Notification implements ShouldQueue
public function toMail(object $notifiable): MailMessage
{
$locale = $notifiable->preferred_language ?? 'ar';
$timeline = $this->update->timeline;
return (new MailMessage)
->subject($this->getSubject($locale))
->view('emails.timeline-update', [
'timelineUpdate' => $this->timelineUpdate,
'timeline' => $this->timelineUpdate->timeline,
'locale' => $locale,
->subject($this->getSubject($locale, $timeline->case_name))
->markdown('emails.timeline.update.'.$locale, [
'update' => $this->update,
'timeline' => $timeline,
'user' => $notifiable,
]);
}
@@ -49,11 +49,11 @@ class TimelineUpdateNotification extends Notification implements ShouldQueue
/**
* Get the subject based on locale.
*/
private function getSubject(string $locale): string
private function getSubject(string $locale, string $caseName): string
{
return $locale === 'ar'
? 'تحديث جديد على قضيتك'
: 'New Update on Your Case';
? "تحديث جديد على قضيتك: {$caseName}"
: "New update on your case: {$caseName}";
}
/**
@@ -65,8 +65,8 @@ class TimelineUpdateNotification extends Notification implements ShouldQueue
{
return [
'type' => 'timeline_update',
'timeline_update_id' => $this->timelineUpdate->id,
'timeline_id' => $this->timelineUpdate->timeline_id,
'timeline_update_id' => $this->update->id,
'timeline_id' => $this->update->timeline_id,
];
}
}