import { ScheduleType as CwScheduleType } from "../../generated/prisma/client";
import { ScheduleType as ApiScheduleType } from "../../../api/generated/prisma/client";
import { Translation } from "./types";

export const scheduleTypeTranslation: Translation<
  CwScheduleType,
  ApiScheduleType
> = {
  values: [
    { from: "scheduleTypeRecId", to: "id" },
    {
      from: "description",
      to: "name",
      process: (value) => (value ? value : "Unknown Type"),
    },
    { from: "description", to: "description" },
    { from: "displayColor", to: "displayColor" },
    { from: "tableReference", to: "tableReference" },
    { from: "moduleId", to: "moduleId" },
    { from: "scheduleTypeId", to: "scheduleTypeId" },
    {
      from: "systemFlag",
      to: "systemFlag",
      process: (value) => Boolean(value),
    },
    {
      from: "displayFlag",
      to: "displayFlag",
      process: (value) => Boolean(value),
    },
    { from: "enteredBy", to: "createdById" },
    { from: "updatedBy", to: "updatedById" },
    { from: "dateEnteredUtc", to: "createdAt" },
    { from: "lastUpdateUtc", to: "updatedAt" },
  ],
};
