skbeta/components/task-table/schema.tsx
Christopher Arraya c55ab3d49e initial commit
2024-01-13 20:55:51 -05:00

23 lines
999 B
TypeScript

import { z } from "zod";
export const taskSchema = z.object({
id: z.string(),
name: z.string(),
description: z.string(),
project_id: z.string(), // Assuming project_id should also be included
project_name: z.string(),
project_description: z.string(),
project_stack: z.array(z.string()),
feature_id: z.string().nullable(),
feature_name: z.string().nullable(), // feature_name could be nullable if a task might not have a related feature
feature_description: z.string().nullable(), // same as feature_name
status: z.enum(["backlog", "todo", "in_progress", "done"]).optional(),
priority: z.string().nullable(),
order: z.number().int().optional(), // Assuming you want to keep the order field
due_date: z.string().nullable().optional(), // If due_date is used and should be in ISO string format
assignee: z.string().nullable(), // Assuming assignee is a string
// Add any other fields from the task table if necessary
});
export type Task = z.infer<typeof taskSchema>;