diff --git a/xtablo-expo/types/tasks.types.ts b/xtablo-expo/types/tasks.types.ts new file mode 100644 index 0000000..85934d8 --- /dev/null +++ b/xtablo-expo/types/tasks.types.ts @@ -0,0 +1,24 @@ +import { Database, Tables, TablesInsert, TablesUpdate } from "@/types/database.types"; +import { RemoveNullFromObject } from "@/types/removeNull"; + +export type TaskStatus = Database["public"]["Enums"]["task_status"]; + +export type Task = RemoveNullFromObject< + Tables<"tasks_with_assignee">, + "id" | "tablo_id" | "is_parent" | "title" | "status" | "position" | "created_at" | "updated_at" +>; + +export type Etape = RemoveNullFromObject< + Tables<"tasks">, + "id" | "tablo_id" | "title" | "is_parent" +>; + +export type TaskInsert = TablesInsert<"tasks">; +export type TaskUpdate = TablesUpdate<"tasks">; + +export const TASK_STATUSES: { value: TaskStatus; label: string; color: string }[] = [ + { value: "todo", label: "À faire", color: "#3b82f6" }, + { value: "in_progress", label: "En cours", color: "#eab308" }, + { value: "in_review", label: "Vérification", color: "#a855f7" }, + { value: "done", label: "Terminé", color: "#22c55e" }, +];