Backend: - Create notifications table (user_id, workspace_id, type, channel, title, body, data JSON, read_at, archived_at) - Create Notification model with Type enum (post_failed, account_disconnected, invite_received, member_joined, member_removed) and Channel enum (email, in_app, both) - Create SendNotification job: isolated from publish flow, handles saving in-app notification and sending email independently - NotificationController: index (excludes archived, scoped to workspace), markAsRead, markAllAsRead, archiveAll - Integrate with PublishToSocialPlatform (post failed/partial) - Integrate with VerifyWorkspaceConnections (batch disconnection) - Integrate with SocialAccount::markAsDisconnected (single disconnection) - All use SendNotification::dispatch() instead of direct Mail::to() Frontend: - NotificationBell component in sidebar footer with unread badge - Dialog with notification list, mark as read, mark all read, archive all - Click navigates to relevant page (post edit, accounts) - i18n for notifications UI (en, es, pt-BR) Tests: - 8 tests for NotificationController (auth, CRUD, workspace scoping) - 4 tests for SendNotification job (channels, email, data storage) All 745 tests passing.
12 lines
170 B
PHP
12 lines
170 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums\Notification;
|
|
|
|
enum Channel: string
|
|
{
|
|
case Email = 'email';
|
|
case InApp = 'in_app';
|
|
case Both = 'both';
|
|
}
|