Skip to content

refactor: split admin stats routes into domain modules - #14

Merged
dataPro-lgtm merged 2 commits into
mainfrom
refactor/split-admin-stats-routes
Aug 3, 2026
Merged

dataPro-lgtm merged 2 commits into
mainfrom
refactor/split-admin-stats-routes

Conversation

@dataPro-lgtm

Copy link
Copy Markdown
Owner

Summary

Mechanical decomposition of the 2253-line admin stats route file. Zero behavior change; stats.ts keeps route registration, capturePlatformSnapshot, and its public re-exports.

Module Lines Contents
stats.ts 395 route handlers + capturePlatformSnapshot
stats/shared.ts 192 thresholds, monitor resolvers, request schemas, recovery-stage helpers
stats/platformSnapshot.ts 511 snapshot summarizers, buildPlatformSnapshot
stats/fetchStats.ts 495 fetchAdminStatsPayload / fetchPlatformStats
stats/renderers.ts 485 CSV and markdown report renderers
stats/commercialContent.ts 245 commercial and content stat queries

Test plan

  • pnpm --filter @sg/api test — 134 passed, unchanged; typecheck/lint green

🤖 Generated with Claude Code

dataPro-lgtm and others added 2 commits August 3, 2026 21:29
Mechanical decomposition of the 2253-line stats route file with zero behavior
change; stats.ts keeps route registration, capturePlatformSnapshot, and its
public re-exports:

- stats/shared.ts (192) — thresholds, monitor resolvers, request schemas,
  recovery-stage/follow-up helpers, ContentStatsResult
- stats/platformSnapshot.ts (511) — snapshot parsing, trend/rollup/cadence/
  regression summarizers, buildPlatformSnapshot
- stats/fetchStats.ts (495) — fetchAdminStatsPayload and fetchPlatformStats
- stats/renderers.ts (485) — CSV and markdown report renderers
- stats/commercialContent.ts (245) — commercial and content stat queries

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dataPro-lgtm
dataPro-lgtm merged commit c019f50 into main Aug 3, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant