notification grouping

This commit is contained in:
Yurii
2026-03-09 14:17:46 +02:00
parent 1877aeecb0
commit 49f7ac30ca
32 changed files with 1514 additions and 130 deletions
@@ -30,6 +30,7 @@
namespace Espo\Controllers;
use Espo\Core\Name\Field;
use Espo\Entities\Notification as NotificationEntity;
use Espo\Tools\Notification\RecordService as Service;
use Espo\Core\Api\Request;
@@ -60,6 +61,7 @@ class Notification extends RecordBase
$maxSize = $searchParamsAux->getMaxSize();
$after = $request->getQueryParam('after');
$beforeNumber = $request->getQueryParam('beforeNumber');
$searchParams = SearchParams
::create()
@@ -76,19 +78,20 @@ class Notification extends RecordBase
->setValue($after)
->build()
);
}
$recordCollection = $this->getNotificationService()->get($this->user, $searchParams);
$recordCollection = $this->getNotificationService()->get($this->user, $searchParams, $beforeNumber);
return $recordCollection->toApiOutput();
}
/**
* @throws BadRequest
* @throws Forbidden
*/
public function getActionNotReadCount(): int
{
$userId = $this->user->getId();
return $this->getNotificationService()->getNotReadCount($userId);
return $this->getNotificationService()->getNotReadCount($this->user);
}
public function postActionMarkAllRead(Request $request): bool