---
title: Workspace Bounded Context
type: entity
created: 2026-09-06
updated: 2026-09-06
sources:
    [
        codebase snapshot 2026-09-06,
        raw/sessions/2026-09-06-frontend-integration.md,
    ]
tags: [workspace, context, issue-tracking]
---

# Workspace Bounded Context

`Workspace` is the top of the issue-tracking hierarchy: a workspace has an owner and contains boards. It is modeled as an aggregate + repository + mapper + Eloquent model, and is the URL-scoped tenant for the issue-tracking UI.

> Updated 2026-09-06: added `workspace_key` and `description`, plus a `findByOwner` read and web presentation. The previously-empty `Api\V1\Workspace\CreateWorkspaceController` stub is superseded by the web `WorkspaceController`.

## Domain

- **Aggregate:** `Domain\Workspace\Entities\Workspace` (`src/Domain/Workspace/Entities/Workspace.php`)
    - Reconstitute-only (`reconstitute(WorkspaceId, workspaceName, workspaceKey, UserId $workspaceOwner, description)`).
    - Getters: `id()`, `workspaceName()`, `workspaceKey()`, `workspaceOwner()`, `description()`.
- **Value object:** `WorkspaceId` (string id).
- **Repository interface:** `WorkspaceRepositoryInterface` — `nextIdentity()`, `save()`, `findById()`, **`findByOwner(UserId): list<Workspace>`**, `all()`.

## Infrastructure

- `WorkspaceModel` (table `workspace`, string PK `workspace_id`; relations: `owner()` BelongsTo to `users`, `boards()` HasMany). Added `workspace_key` and `description`.
- `WorkspaceMapper`, `EloquentWorkspaceRepository` (implements `findByOwner`).

## Presentation

- **Web controller:** `app/Http/Controllers/Web/WorkspaceController` — `overview()` renders the workspace overview page; `store()` creates a workspace **and its default `Backlog` board**.
- The old `app/Http/Controllers/Api/V1/Workspace/CreateWorkspaceController.php` is an empty stub with no routes (left over from the API scaffold).

## Persistence / relationships

Created in the (misnamed) `2026_09_05_071303_add_tickets_table.php` migration; extended by `2026_09_06_000000_extend_for_issue_tracking.php`. The `workspace` table has a FK `workspace_owner` → `users.user_id`. `workspace` is the parent of `board`, which is the parent of `ticket`.

## Observations / open questions

- **A default board is created on workspace creation** (the UI has no board concept; all issues live under the workspace's boards).
- Whether `Workspace` is the tenant boundary for multi-tenancy (vs. `User` being global) remains an open modeling question worth an ADR.

## Related pages

- [board](board.md) — child context
- [ticket](ticket.md) — the leaf/issue context
- [user](user.md) — the owner reference
- [overview](../overview.md) — project context