19 lines
700 B
TypeScript
19 lines
700 B
TypeScript
import { z } from "zod";
|
|
import { GOAL_LEVELS, GOAL_STATUSES } from "../constants.js";
|
|
import { objectWithoutDefaults } from "./partial.js";
|
|
|
|
export const createGoalSchema = z.object({
|
|
title: z.string().min(1),
|
|
description: z.string().optional().nullable(),
|
|
level: z.enum(GOAL_LEVELS).optional().default("task"),
|
|
status: z.enum(GOAL_STATUSES).optional().default("planned"),
|
|
parentId: z.string().guid().optional().nullable(),
|
|
ownerAgentId: z.string().guid().optional().nullable(),
|
|
});
|
|
|
|
export type CreateGoal = z.infer<typeof createGoalSchema>;
|
|
|
|
export const updateGoalSchema = objectWithoutDefaults(createGoalSchema).partial();
|
|
|
|
export type UpdateGoal = z.infer<typeof updateGoalSchema>;
|