/** Trạng thái công việc (yêu cầu mục 4) — dùng chuỗi, không dùng enum Postgres; xem chú thích ở bảng `tasks`. */
export const TASK_STATUSES = [
  { key: "NOT_STARTED", label: "Chưa bắt đầu", needsReason: false },
  { key: "WAITING", label: "Chờ phản hồi", needsReason: false },
  { key: "DONE", label: "Đã hoàn thành", needsReason: false },
  { key: "POSTPONED", label: "Dời", needsReason: true },
  { key: "INCOMPLETE", label: "Chưa hoàn thành", needsReason: true },
  { key: "CANCELLED", label: "Huỷ", needsReason: true },
] as const;

export type TaskStatus = (typeof TASK_STATUSES)[number]["key"];

export const TASK_STATUS_LABEL: Record<string, string> = Object.fromEntries(
  TASK_STATUSES.map((s) => [s.key, s.label]),
);

/** Còn đang làm dở — chưa đi tới trạng thái kết thúc. */
export const OPEN_TASK_STATUSES: string[] = ["NOT_STARTED", "WAITING", "POSTPONED", "INCOMPLETE"];
