feat: add project_goals many-to-many join table
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>
This commit is contained in:
@@ -49,6 +49,7 @@ export type {
|
||||
AdapterEnvironmentTestResult,
|
||||
AssetImage,
|
||||
Project,
|
||||
ProjectGoalRef,
|
||||
Issue,
|
||||
IssueComment,
|
||||
IssueAttachment,
|
||||
|
||||
@@ -10,7 +10,7 @@ export type {
|
||||
AdapterEnvironmentTestResult,
|
||||
} from "./agent.js";
|
||||
export type { AssetImage } from "./asset.js";
|
||||
export type { Project } from "./project.js";
|
||||
export type { Project, ProjectGoalRef } from "./project.js";
|
||||
export type {
|
||||
Issue,
|
||||
IssueComment,
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
import type { ProjectStatus } from "../constants.js";
|
||||
|
||||
export interface ProjectGoalRef {
|
||||
id: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export interface Project {
|
||||
id: string;
|
||||
companyId: string;
|
||||
/** @deprecated Use goalIds / goals instead */
|
||||
goalId: string | null;
|
||||
goalIds: string[];
|
||||
goals: ProjectGoalRef[];
|
||||
name: string;
|
||||
description: string | null;
|
||||
status: ProjectStatus;
|
||||
|
||||
@@ -2,7 +2,9 @@ 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"),
|
||||
|
||||
Reference in New Issue
Block a user