refactor(bot): move playlist service out of utils into services

Merged
LU
3mo ago
+437-427

Stacked on #1981 (not yet merged) — both touch idleDisconnect.ts and leave.ts.

Summary

  • Second bounded slice of #1968: collaborativePlaylist.ts holds CollaborativePlaylistService, a stateful class with module-level Map state, mislabeled as a util. Zero internal imports of its own.
  • Moved to services/musicRecommendation/, updated 4 real import sites (idleDisconnect.ts, leave.ts, playlist.ts, playHandler.ts) plus 2 jest.mock() string-literal mocks (playlist.spec.ts, play/index.spec.ts) that a prior grep-only research pass for the watchdog slice missed — caught this time with a repo-wide grep before committing.

Verification

  • npm run type:check --workspace=@lucky/bot — clean
  • npm run test:bot — 242/243 suites (1 pre-existing skip, unchanged count)
  • npm run lint --workspace=@lucky/bot — 0 errors, 73 pre-existing warnings (unchanged)
  • Repo-wide grep for the old path after the move — zero remaining references

Summary by cubic

Moved the stateful collaborative playlist logic into a service under services/musicRecommendation to clarify module boundaries. No behavior changes.

  • Refactors
    • Relocated collaborativePlaylist.ts and its spec to services/musicRecommendation/collaborativePlaylist.
    • Updated imports in leave.ts, playlist.ts, play/handlers/playHandler.ts, and utils/music/idleDisconnect.ts.
    • Updated jest.mock paths in functions/music/commands/playlist.spec.ts and functions/music/commands/play/index.spec.ts.
    • Verified clean typecheck, tests, and lint in @lucky/bot.
    • Note: overlaps with the watchdog-to-services work; both touch idleDisconnect.ts and leave.ts.