Skip to content

refactor: split teamWorkspacesRepository into domain modules - #13

Merged
dataPro-lgtm merged 1 commit into
mainfrom
refactor/split-team-workspaces-repository
Aug 3, 2026
Merged

dataPro-lgtm merged 1 commit into
mainfrom
refactor/split-team-workspaces-repository

Conversation

@dataPro-lgtm

Copy link
Copy Markdown
Owner

Summary

Mechanical decomposition of the 5637-line repository file — the P0 item from the execution plan's M5 follow-ups. Zero behavior change; repositories/teamWorkspacesRepository.ts stays as a re-export facade so no import paths move.

Module Lines Contents
teamWorkspaces/contract.ts 448 record/row types, shared constants, TeamWorkspacesRepository interface
teamWorkspaces/helpers.ts 1061 pure row mappers, billing/recovery/access builders
teamWorkspaces/mockRepository.ts 1615 MockTeamWorkspacesRepository
teamWorkspaces/pgRepository.ts 2679 PgTeamWorkspacesRepository

Follow-up: pgRepository.ts still exceeds the ~1500-line target; shrinking it requires a delegation split of the class itself.

Test plan

  • pnpm --filter @sg/api test — 134 passed, unchanged
  • typecheck and lint green; CI PostgreSQL + browser gates cover both implementations

🤖 Generated with Claude Code

Mechanical decomposition of the 5637-line repository file with zero behavior
change; the original path stays as a re-export facade so no import moves:

- teamWorkspaces/contract.ts (448) — record/row types, shared constants, and
  the TeamWorkspacesRepository interface
- teamWorkspaces/helpers.ts (1061) — pure row mappers plus billing, recovery,
  and workspace-access builders shared by both implementations
- teamWorkspaces/mockRepository.ts (1615) — MockTeamWorkspacesRepository
- teamWorkspaces/pgRepository.ts (2679) — PgTeamWorkspacesRepository

Follow-up: pgRepository still exceeds the 1500-line target; shrinking it needs
a delegation split of the class itself, tracked in the execution plan.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dataPro-lgtm
dataPro-lgtm merged commit d7852ff into main Aug 3, 2026
20 of 22 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