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