feat: complete Epic 0 — foundation migration & infrastructure setup
Stories 0.2-0.5: rename folders→declarations (backend+frontend), configure Redis for cache/queue/sessions, add foundation database migrations (permissions, archived_at), replace DeclarationStatus enum with architecture lifecycle values, create DeclarationObserver for status transition validation and auto-archive, fix controller status transitions to respect observer rules. 93 tests pass (240 assertions). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,19 +2,19 @@
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Models\Folder;
|
||||
use App\Models\Declaration;
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
class FolderMentionNotification extends Notification implements ShouldQueue
|
||||
class DeclarationMentionNotification extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public function __construct(
|
||||
public Folder $folder,
|
||||
public Declaration $declaration,
|
||||
public User $mentionedBy,
|
||||
public string $message,
|
||||
) {}
|
||||
@@ -33,24 +33,24 @@ class FolderMentionNotification extends Notification implements ShouldQueue
|
||||
public function toDatabase(object $notifiable): array
|
||||
{
|
||||
return [
|
||||
'folder_id' => $this->folder->id,
|
||||
'folder_title' => $this->folder->title,
|
||||
'declaration_id' => $this->declaration->id,
|
||||
'declaration_title' => $this->declaration->title,
|
||||
'mentioned_by_id' => $this->mentionedBy->id,
|
||||
'mentioned_by_name' => $this->mentionedBy->name,
|
||||
'message' => $this->message,
|
||||
'url' => route('folders.show', $this->folder),
|
||||
'url' => route('declarations.show', $this->declaration),
|
||||
];
|
||||
}
|
||||
|
||||
public function toMail(object $notifiable): MailMessage
|
||||
{
|
||||
return (new MailMessage)
|
||||
->subject('Vous avez été mentionné - '.$this->folder->title)
|
||||
->markdown('emails.folder-mention', [
|
||||
'folderTitle' => $this->folder->title,
|
||||
->subject('Vous avez été mentionné - '.$this->declaration->title)
|
||||
->markdown('emails.declaration-mention', [
|
||||
'declarationTitle' => $this->declaration->title,
|
||||
'mentionedByName' => $this->mentionedBy->name,
|
||||
'message' => $this->message,
|
||||
'url' => route('folders.show', $this->folder),
|
||||
'url' => route('declarations.show', $this->declaration),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user