Created a skeleton of the api
This commit is contained in:
10
src/lib/data/list-variants.ts
Normal file
10
src/lib/data/list-variants.ts
Normal 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[],
|
||||
];
|
||||
13
src/lib/data/task-labels.ts
Normal file
13
src/lib/data/task-labels.ts
Normal 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[],
|
||||
];
|
||||
10
src/lib/data/task-priority.ts
Normal file
10
src/lib/data/task-priority.ts
Normal 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[],
|
||||
];
|
||||
12
src/lib/data/task-status.ts
Normal file
12
src/lib/data/task-status.ts
Normal 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[],
|
||||
];
|
||||
13
src/lib/schemas/list-creation-form.ts
Normal file
13
src/lib/schemas/list-creation-form.ts
Normal 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
|
||||
});
|
||||
3
src/lib/schemas/task-creation-form.ts
Normal file
3
src/lib/schemas/task-creation-form.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const taskCreationFormSchema = z.object({});
|
||||
Reference in New Issue
Block a user