Compare commits

...

2 commits

Author SHA1 Message Date
Nicolas HOARAU 8970f46a80 chore(ci): Ignore the .opencode/ directory as per best practice.
All checks were successful
ci / ci (22) (push) Successful in 10m34s
2026-06-10 02:16:09 +04:00
Nicolas HOARAU 2808f82c29 feat(schema): Refactored valibot definitions to use helper function for cleaner enum handling 2026-06-10 02:09:51 +04:00
2 changed files with 15 additions and 10 deletions

3
.gitignore vendored
View file

@ -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

View file

@ -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,
});