Files
outline/server/presenters/documentInsight.ts
T
Tom Moor 600108bc43 feat: Document insight rollups (#12086)
* First pass

* Remove popularity changes

* Address review feedback

- Compute retention cutoff in UTC from the database rather than worker-local TZ
- Push partition predicate into rollup source CTEs to avoid full-table scans per partition

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Anchor insight rollups to UTC and include today

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 08:11:15 -04:00

14 lines
407 B
TypeScript

import type { DocumentInsight } from "@server/models";
export default function presentDocumentInsight(insight: DocumentInsight) {
return {
date: insight.date,
viewCount: insight.viewCount,
viewerCount: insight.viewerCount,
commentCount: insight.commentCount,
reactionCount: insight.reactionCount,
revisionCount: insight.revisionCount,
editorCount: insight.editorCount,
};
}