Files
paperclip/packages/shared/src/validators/project.ts
T
Forgotten 29af525167 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>
2026-02-25 08:38:46 -06:00

37 lines
1.4 KiB
TypeScript

import { z } from "zod";
import { PROJECT_STATUSES } from "../constants.js";
export const createProjectSchema = z.object({
/** @deprecated Use goalIds instead */
goalId: z.string().uuid().optional().nullable(),
goalIds: z.array(z.string().uuid()).optional(),
name: z.string().min(1),
description: z.string().optional().nullable(),
status: z.enum(PROJECT_STATUSES).optional().default("backlog"),
leadAgentId: z.string().uuid().optional().nullable(),
targetDate: z.string().optional().nullable(),
color: z.string().optional().nullable(),
archivedAt: z.string().datetime().optional().nullable(),
});
export type CreateProject = z.infer<typeof createProjectSchema>;
export const updateProjectSchema = createProjectSchema.partial();
export type UpdateProject = z.infer<typeof updateProjectSchema>;
export const createProjectWorkspaceSchema = z.object({
name: z.string().min(1),
cwd: z.string().min(1),
repoUrl: z.string().url().optional().nullable(),
repoRef: z.string().optional().nullable(),
metadata: z.record(z.unknown()).optional().nullable(),
isPrimary: z.boolean().optional().default(false),
});
export type CreateProjectWorkspace = z.infer<typeof createProjectWorkspaceSchema>;
export const updateProjectWorkspaceSchema = createProjectWorkspaceSchema.partial();
export type UpdateProjectWorkspace = z.infer<typeof updateProjectWorkspaceSchema>;