From 5cfb892e11937a47d3ceb5a9e625f69a666e9318 Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Wed, 15 Apr 2026 09:35:13 +0200 Subject: [PATCH] feat(expo): add task and etape type definitions Co-Authored-By: Claude Sonnet 4.6 --- xtablo-expo/types/tasks.types.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 xtablo-expo/types/tasks.types.ts 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" }, +];