import { ScheduleStatus as CwScheduleStatus } from "../../generated/prisma/client";
import { ScheduleStatus as ApiScheduleStatus } from "../../../api/generated/prisma/client";
import { Translation } from "./types";

export const scheduleStatusTranslation: Translation<
  CwScheduleStatus,
  ApiScheduleStatus
> = {
  values: [
    { from: "scheduleStatusRecId", to: "id" },
    {
      from: "description",
      to: "name",
      process: (value) => (value ? value : "Unknown Status"),
    },
    { from: "description", to: "description" },
    { from: "color", to: "color" },
    {
      from: "softFlag",
      to: "softFlag",
      process: (value) => Boolean(value),
    },
    {
      from: "defaultFlag",
      to: "defaultFlag",
      process: (value) => Boolean(value),
    },
    { from: "enteredBy", to: "createdById" },
    { from: "updatedBy", to: "updatedById" },
    { from: "dateEnteredUtc", to: "createdAt" },
    { from: "lastUpdateUtc", to: "updatedAt" },
  ],
};
