refactor(audit): document MIN invariant in aggregated CTE comment
Some checks failed
CI / Unit & Component Tests (push) Failing after 2m37s
CI / OCR Service Tests (push) Successful in 32s
CI / Backend Unit Tests (push) Failing after 2m53s
CI / Unit & Component Tests (pull_request) Failing after 2m36s
CI / OCR Service Tests (pull_request) Successful in 31s
CI / Backend Unit Tests (pull_request) Failing after 2m48s
Some checks failed
CI / Unit & Component Tests (push) Failing after 2m37s
CI / OCR Service Tests (push) Successful in 32s
CI / Backend Unit Tests (push) Failing after 2m53s
CI / Unit & Component Tests (pull_request) Failing after 2m36s
CI / OCR Service Tests (pull_request) Successful in 31s
CI / Backend Unit Tests (pull_request) Failing after 2m48s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -71,6 +71,7 @@ public interface AuditLogQueryRepository extends JpaRepository<AuditLog, UUID> {
|
|||||||
COUNT(*)::int AS count,
|
COUNT(*)::int AS count,
|
||||||
BOOL_OR(s.kind = 'MENTION_CREATED'
|
BOOL_OR(s.kind = 'MENTION_CREATED'
|
||||||
AND s.payload->>'mentionedUserId' = :currentUserId) AS you_mentioned,
|
AND s.payload->>'mentionedUserId' = :currentUserId) AS you_mentioned,
|
||||||
|
-- COMMENT_ADDED/MENTION_CREATED always have is_new_session=1, so each group has one row and MIN collapses to that row payload
|
||||||
MIN(s.payload::text)::jsonb AS payload
|
MIN(s.payload::text)::jsonb AS payload
|
||||||
FROM sessions s
|
FROM sessions s
|
||||||
GROUP BY s.kind, s.actor_id, s.document_id, s.session_id
|
GROUP BY s.kind, s.actor_id, s.document_id, s.session_id
|
||||||
|
|||||||
Reference in New Issue
Block a user