-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: crud task according to workflow (#19)
* feat: crud task according to workflow * refactor: remove workflow * feat: add endpoint to assign/unassign task * fix: remove additional properties by default * fix: disable allErrors ajv
- Loading branch information
1 parent
3d165b2
commit 13e73b4
Showing
11 changed files
with
493 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,36 @@ | ||
import { Type } from "@sinclair/typebox"; | ||
import { Static, Type } from "@sinclair/typebox"; | ||
|
||
export const TaskStatus = { | ||
New: 'new', | ||
InProgress: 'in-progress', | ||
OnHold: 'on-hold', | ||
Completed: 'completed', | ||
Canceled: 'canceled', | ||
Archived: 'archived' | ||
} as const; | ||
|
||
export type TaskStatusType = typeof TaskStatus[keyof typeof TaskStatus]; | ||
|
||
export const TaskSchema = Type.Object({ | ||
id: Type.Number(), | ||
name: Type.String() | ||
name: Type.String(), | ||
author_id: Type.Number(), | ||
assigned_user_id: Type.Optional(Type.Number()), | ||
status: Type.String(), | ||
created_at: Type.String({ format: "date-time" }), | ||
updated_at: Type.String({ format: "date-time" }) | ||
}); | ||
|
||
export interface Task extends Static<typeof TaskSchema> {} | ||
|
||
export const CreateTaskSchema = Type.Object({ | ||
name: Type.String(), | ||
author_id: Type.Number(), | ||
assigned_user_id: Type.Optional(Type.Number()) | ||
}); | ||
|
||
export const UpdateTaskSchema = Type.Object({ | ||
name: Type.Optional(Type.String()), | ||
assigned_user_id: Type.Optional(Type.Number()) | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.