xtablo-source/xtablo-expo/types/tasks.types.ts
2026-04-29 15:45:31 +02:00

25 lines
981 B
TypeScript

import { Database, Tables, TablesInsert, TablesUpdate } from "@/types/database.types";
import { PRIMARY } from "@/constants/colors";
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: PRIMARY },
{ value: "in_progress", label: "En cours", color: "#eab308" },
{ value: "in_review", label: "Vérification", color: "#a855f7" },
{ value: "done", label: "Terminé", color: "#22c55e" },
];