feat: add project workspaces (DB, API, service, and UI)

New project_workspaces table with primary workspace designation.
Full CRUD routes, service with auto-primary promotion on delete,
workspace management UI in project properties panel, and workspace
data included in project/issue ancestor responses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Forgotten
2026-02-25 08:38:46 -06:00
parent 6f7172c028
commit 29af525167
10 changed files with 6273 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
import type { Project } from "@paperclip/shared";
import type { Project, ProjectWorkspace } from "@paperclip/shared";
import { api } from "./client";
export const projectsApi = {
@@ -7,5 +7,13 @@ export const projectsApi = {
create: (companyId: string, data: Record<string, unknown>) =>
api.post<Project>(`/companies/${companyId}/projects`, data),
update: (id: string, data: Record<string, unknown>) => api.patch<Project>(`/projects/${id}`, data),
listWorkspaces: (projectId: string) =>
api.get<ProjectWorkspace[]>(`/projects/${projectId}/workspaces`),
createWorkspace: (projectId: string, data: Record<string, unknown>) =>
api.post<ProjectWorkspace>(`/projects/${projectId}/workspaces`, data),
updateWorkspace: (projectId: string, workspaceId: string, data: Record<string, unknown>) =>
api.patch<ProjectWorkspace>(`/projects/${projectId}/workspaces/${workspaceId}`, data),
removeWorkspace: (projectId: string, workspaceId: string) =>
api.delete<ProjectWorkspace>(`/projects/${projectId}/workspaces/${workspaceId}`),
remove: (id: string) => api.delete<Project>(`/projects/${id}`),
};