Created a skeleton of the api

This commit is contained in:
2024-11-22 19:45:29 -06:00
parent a9c055ddab
commit 38a5abbbc8
10 changed files with 120 additions and 41 deletions

View File

@@ -0,0 +1,10 @@
export const VARIANT = {
standard: "Standard",
checklist: "Checklist",
project: "Project",
} as const;
export const VARIANTS = Object.values(VARIANT) as unknown as readonly [
string,
...string[],
];

View File

@@ -0,0 +1,13 @@
export const LABEL = {
feature: "Feature",
bug: "Bug",
docs: "Docs",
chore: "Chore",
refactor: "Refactor",
build: "Build",
} as const;
export const LABELS = Object.values(LABEL) as unknown as readonly [
string,
...string[],
];

View File

@@ -0,0 +1,10 @@
export const PRIORITY = {
high: "High",
medium: "Medium",
low: "Low",
} as const;
export const PRIORITIES = Object.values(PRIORITY) as unknown as readonly [
string,
...string[],
];

View File

@@ -0,0 +1,12 @@
export const STATUS = {
backlog: "Backlog",
todo: "Todo",
inProgress: "In Progress",
done: "Done",
canceled: "Canceled",
} as const;
export const STATUSES = Object.values(STATUS) as unknown as readonly [
string,
...string[],
];

View File

@@ -0,0 +1,13 @@
import { z } from "zod";
import { LABELS } from "~/lib/data/task-labels";
import { VARIANTS } from "~/lib/data/list-variants";
export const listNameSchema = z.string().max(128);
export const listCreationFormSchema = z.object({
name: listNameSchema, // Text
variant: z.union([z.enum(VARIANTS).optional(), z.literal("")]), // Radio group
labels: z.array(z.enum(LABELS)), // Checkbox group
id: z.boolean(), // Checkbox
idPrefix: z.string().max(8), // Text
});

View File

@@ -0,0 +1,3 @@
import { z } from "zod";
export const taskCreationFormSchema = z.object({});