Compare commits
No commits in common. "8970f46a8059736e9bf8c90562e9111585c3f7b5" and "f11c306ac69b3cdc0c6fefc7cec4c7e69e38035b" have entirely different histories.
8970f46a80
...
f11c306ac6
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -27,8 +27,6 @@ out/
|
||||||
build
|
build
|
||||||
dist
|
dist
|
||||||
|
|
||||||
# OpenSpec / Environment specific files
|
|
||||||
.opencode/
|
|
||||||
|
|
||||||
# Debug
|
# Debug
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
|
|
@ -38,3 +36,4 @@ yarn-error.log*
|
||||||
# Misc
|
# Misc
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.pem
|
*.pem
|
||||||
|
opencode.json
|
||||||
|
|
|
||||||
|
|
@ -2,33 +2,29 @@ import { createInsertSchema, createSelectSchema, createUpdateSchema } from "driz
|
||||||
import { pipe, picklist } from "valibot";
|
import { pipe, picklist } from "valibot";
|
||||||
import { projects, tasks, PROJECT_STATUSES, TASK_STATUSES, PRIORITIES } from "./drizzle/index";
|
import { projects, tasks, PROJECT_STATUSES, TASK_STATUSES, PRIORITIES } from "./drizzle/index";
|
||||||
|
|
||||||
const createProjectStatusSchema = (schema: any) => pipe(schema, picklist([...PROJECT_STATUSES])) as any;
|
|
||||||
const createTaskStatusSchema = (schema: any) => pipe(schema, picklist([...TASK_STATUSES])) as any;
|
|
||||||
const createPrioritySchema = (schema: any) => pipe(schema, picklist([...PRIORITIES])) as any;
|
|
||||||
|
|
||||||
export const projectSelect = createSelectSchema(projects, {
|
export const projectSelect = createSelectSchema(projects, {
|
||||||
status: createProjectStatusSchema,
|
status: (schema: any) => pipe(schema, picklist([...PROJECT_STATUSES])) as any,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const taskSelect = createSelectSchema(tasks, {
|
export const taskSelect = createSelectSchema(tasks, {
|
||||||
status: createTaskStatusSchema,
|
status: (schema: any) => pipe(schema, picklist([...TASK_STATUSES])) as any,
|
||||||
priority: createPrioritySchema,
|
priority: (schema: any) => pipe(schema, picklist([...PRIORITIES])) as any,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const projectInsert = createInsertSchema(projects, {
|
export const projectInsert = createInsertSchema(projects, {
|
||||||
status: createProjectStatusSchema,
|
status: (schema: any) => pipe(schema, picklist([...PROJECT_STATUSES])) as any,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const projectUpdate = createUpdateSchema(projects, {
|
export const projectUpdate = createUpdateSchema(projects, {
|
||||||
status: createProjectStatusSchema,
|
status: (schema: any) => pipe(schema, picklist([...PROJECT_STATUSES])) as any,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const taskInsert = createInsertSchema(tasks, {
|
export const taskInsert = createInsertSchema(tasks, {
|
||||||
status: createTaskStatusSchema,
|
status: (schema: any) => pipe(schema, picklist([...TASK_STATUSES])) as any,
|
||||||
priority: createPrioritySchema,
|
priority: (schema: any) => pipe(schema, picklist([...PRIORITIES])) as any,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const taskUpdate = createUpdateSchema(tasks, {
|
export const taskUpdate = createUpdateSchema(tasks, {
|
||||||
status: createTaskStatusSchema,
|
status: (schema: any) => pipe(schema, picklist([...TASK_STATUSES])) as any,
|
||||||
priority: createPrioritySchema,
|
priority: (schema: any) => pipe(schema, picklist([...PRIORITIES])) as any,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue