mirror of
https://github.com/paperclipai/paperclip
synced 2026-03-25 11:21:48 +00:00
Create project_goals join table with composite PK (project_id, goal_id), backfill from existing projects.goal_id, and update the project service to read/write through the join table. Shared types now include goalIds and goals arrays on Project. Legacy goalId column is kept in sync. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
20 lines
715 B
TypeScript
20 lines
715 B
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(),
|
|
});
|
|
|
|
export type CreateProject = z.infer<typeof createProjectSchema>;
|
|
|
|
export const updateProjectSchema = createProjectSchema.partial();
|
|
|
|
export type UpdateProject = z.infer<typeof updateProjectSchema>;
|