fixed notification system and added a new tenant notifications receipt table to track read status and filter messages by scope.

This commit is contained in:
Codex Agent
2025-12-17 10:57:19 +01:00
parent 0aae494945
commit d64839ba2f
31 changed files with 1089 additions and 127 deletions

View File

@@ -44,11 +44,24 @@ class SendEventPackageGalleryWarning implements ShouldQueue
}
$preferences = app(\App\Services\Packages\TenantNotificationPreferences::class);
$context = $this->context($eventPackage);
if ($this->isDuplicateNotification($tenant, 'gallery_warning', $context, ['event_package_id', 'days_remaining'])) {
$this->logNotification($tenant, [
'type' => 'gallery_warning',
'status' => 'skipped',
'context' => array_merge($context, ['reason' => 'duplicate']),
]);
return;
}
if (! $preferences->shouldNotify($tenant, 'gallery_warnings')) {
$this->logNotification($tenant, [
'type' => 'gallery_warning',
'status' => 'skipped',
'context' => $this->context($eventPackage),
'context' => $context,
]);
return;
@@ -69,14 +82,12 @@ class SendEventPackageGalleryWarning implements ShouldQueue
$this->logNotification($tenant, [
'type' => 'gallery_warning',
'status' => 'skipped',
'context' => array_merge($this->context($eventPackage), ['reason' => 'no_recipient']),
'context' => array_merge($context, ['reason' => 'no_recipient']),
]);
return;
}
$context = $this->context($eventPackage);
$this->dispatchToRecipients(
$tenant,
$emails,