Notification Repository
Repositório para acesso a dados de notificações do sistema. Fornece métodos para listar, marcar como lida e contar notificações.
Functions
Link copied to clipboard
@Query(value = "
SELECT COUNT(n) FROM Notification n
WHERE n.tenantId = :tenantId
AND (n.userId IS NULL OR n.userId = :userId)
AND n.read = false
" )
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Query(value = "
SELECT n FROM Notification n
WHERE n.tenantId = :tenantId
AND (n.userId IS NULL OR n.userId = :userId)
ORDER BY n.createdAt DESC
" )
Link copied to clipboard
@Query(value = "
SELECT n FROM Notification n
WHERE n.tenantId = :tenantId
AND (n.userId IS NULL OR n.userId = :userId)
AND n.read = false
ORDER BY n.createdAt DESC
" )
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Modifying
@Query(value = "
UPDATE Notification n
SET n.read = true
WHERE n.tenantId = :tenantId
AND (n.userId IS NULL OR n.userId = :userId)
AND n.read = false
" )
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard