Add shared types package
Shared TypeScript types, Zod validators, API contract definitions, and constants used by both server and UI. Covers agents, goals, issues, projects, and activity entities. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
16
packages/shared/src/validators/goal.ts
Normal file
16
packages/shared/src/validators/goal.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { z } from "zod";
|
||||
import { GOAL_LEVELS } from "../constants.js";
|
||||
|
||||
export const createGoalSchema = z.object({
|
||||
title: z.string().min(1),
|
||||
description: z.string().optional().nullable(),
|
||||
level: z.enum(GOAL_LEVELS),
|
||||
parentId: z.string().uuid().optional().nullable(),
|
||||
ownerId: z.string().uuid().optional().nullable(),
|
||||
});
|
||||
|
||||
export type CreateGoal = z.infer<typeof createGoalSchema>;
|
||||
|
||||
export const updateGoalSchema = createGoalSchema.partial();
|
||||
|
||||
export type UpdateGoal = z.infer<typeof updateGoalSchema>;
|
||||
Reference in New Issue
Block a user