Commit Graph

2 Commits

Author SHA1 Message Date
Ahmed Bouhuolia
1a73d499ee feat(workspaces): enhance workspace creation and job management
- Introduced a transaction for creating tenants, linking users, and saving metadata in the `CreateWorkspaceService`.
- Moved tenant marking as building to the `markAsBuilding` method for better separation of concerns.
- Added `WorkspaceBuildJobResponseDto` for improved API response structure.
- Updated `GetWorkspacesService` to utilize a transformer for cleaner data mapping.
- Added unit tests for `CreateWorkspaceService` to ensure robust functionality and error handling.
2026-04-01 23:32:28 +02:00
Ahmed Bouhuolia
e968cf646c feat(ee): add multi-organization workspaces feature
- Add `user_tenants` system DB migration for many-to-many user-to-org relationship
- Add backfill migration to populate existing users into join table
- Add `UserTenant` Objection.js system model and register globally
- Enforce org membership validation in `TenancyGlobalGuard` (security)
- Add `modules/ee/Workspaces` with full CRUD: create, list, delete, build-status
- Add `CreateUserTenantOnSignupSubscriber` for backward-compatible signup flow
- Register `WorkspacesModule` in `AppModule`

API endpoints:
  GET  /workspaces              - list all orgs user belongs to
  POST /workspaces              - create new org (async build)
  GET  /workspaces/build/:jobId - poll build job status
  DELETE /workspaces/:orgId     - delete org (owner only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 16:49:54 +02:00