import { SrSeverity as CwServiceTicketSeverity } from "../../generated/prisma/client";
import { ServiceTicketSeverity as ApiServiceTicketSeverity } from "../../../api/generated/prisma/client";
import { Translation } from "./types";

export const serviceTicketSeverityTranslation: Translation<
  CwServiceTicketSeverity,
  ApiServiceTicketSeverity
> = {
  values: [
    { from: "srSeverityRecId", to: "id" },
    {
      from: "severityName",
      to: "name",
      process: (value) => (value ? value : "Unknown Severity"),
    },
    { from: "severityDesc", 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" },
  ],
};
