mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 18:30:39 +09:00
17 lines
513 B
TypeScript
17 lines
513 B
TypeScript
|
|
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>;
|