import { SrImpact as CwServiceTicketImpact } from "../../generated/prisma/client";
import { ServiceTicketImpact as ApiServiceTicketImpact } from "../../../api/generated/prisma/client";
import { Translation } from "./types";

export const serviceTicketImpactTranslation: Translation<
  CwServiceTicketImpact,
  ApiServiceTicketImpact
> = {
  values: [
    { from: "srImpactRecId", to: "id" },
    {
      from: "impactName",
      to: "name",
      process: (value) => (value ? value : "Unknown Impact"),
    },
    { from: "impactDesc", to: "description" },
    {
      from: "defaultFlag",
      to: "defaultFlag",
      process: (value) => Boolean(value),
    },
    { from: "enteredBy", to: "createdById" },
    { from: "updatedBy", to: "updatedById" },
    { from: "dateEnteredUtc", to: "createdAt" },
    { from: "lastUpdatedUtc", to: "updatedAt" },
  ],
};
