Skip to content

feat(server): add workspaces REST endpoints (list/create/get) - #13

Merged
facyndev merged 1 commit into
developfrom
feature/api-rest-crud-01-workspaces
Oct 18, 2026
Merged

facyndev merged 1 commit into
developfrom
feature/api-rest-crud-01-workspaces

Conversation

@facyndev

@facyndev facyndev commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds WorkspacesController: POST /workspaces (caller becomes owner), GET /workspaces (owner-or-member listing with member counts), GET /workspaces/:id (detail with members; 404 unknown, 403 no access).
  • Adds WorkspaceRepository.listForUser and UserRepository.findByIds to back the listings/projections.
  • New CollabModule (Persistence + Auth) with strict zod ZodPipe body validation and AccessGuard on every route (S14): no token → 401.

Changes

File Change
apps/api/src/collab/workspaces.controller.ts 3 authenticated routes (create/list/detail)
apps/api/src/collab/workspace.service.ts create/list/detail orchestration
apps/api/src/collab/dto.ts, views.ts strict zod schemas + workspace views (memberCount)
apps/api/src/collab/collab.module.ts new module wiring controllers/services
apps/api/src/persistence/workspace.repository.ts listForUser (owner or member)
apps/api/src/collab/workspaces.controller.int.spec.ts 13 integration tests (RED→GREEN)

Test evidence

  • Integration: 107/107 (13 new) · Unit: 166/166 · typecheck clean · gitleaks clean
  • RDD review of this commit: tier high, approved (lineage review-78dd02cdbbd5c9c3), 0 blockers. Advisories R3-001/R3-002 are tracked as follow-ups in the feature doc (odd/tasks/api-rest-crud.md, L6).

Chain Context

Field Value
Chain api-rest-crud (REST CRUD: workspaces / sessions / terminals / invitations)
Tracker PR Draft PR feature/api-rest-crud → develop (created after the slice PRs)
Position 1 of 3 slices
Base develop
Depends on None
Follow-up #14 (sessions + terminals, T2+T3)
Review budget 463 / 400 — size:exception: single cohesive work unit (controller + repository + module + its tests), already RDD-reviewed as one unit
Starts at develop (6a45795)
Ends with Workspaces REST surface available behind auth

Chain Overview

develop
  └── � #<this> workspaces (T1)
       └── sessions + terminals (T2+T3)
            └── invitations + AppModule wiring (T4+T5)
                 └── draft tracker PR: feature/api-rest-crud → develop (full feature)

Scope

  • Includes: workspaces endpoints, listForUser, CollabModule scaffolding, module/auth wiring
  • Excludes: sessions/terminals/invitations endpoints (next slices), desktop dual storage mode (separate feature)

Autonomy

  • CI is expected to pass for this PR branch
  • This PR has one deliverable scope
  • This PR can be rolled back without unrelated changes
  • Tests cover this unit (13 integration tests)

New CollabModule with WorkspacesController: POST /workspaces, GET /workspaces, GET /workspaces/:id. Adds WorkspaceRepository.listForUser and UserRepository.findByIds; AuthModule now exports AuthService and AccessGuard for reuse by future collab controllers. Specs S1-S3/S14 in odd/tasks/api-rest-crud.md.
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