import { ProductSubcategory as CwProductSubcategory } from "../../generated/prisma/client";
import { CatalogSubcategory as ApiCatalogSubcategory } from "../../../api/generated/prisma/client";
import { Translation } from "./types";

export const catalogSubcategoryTranslation: Translation<
  CwProductSubcategory,
  ApiCatalogSubcategory
> = {
  values: [
    { from: "subcategoryRecId", to: "id" },
    {
      from: "description",
      to: "name",
      process: (value) => (value ? value : "Unknown Subcategory"),
    },
    { from: "description", to: "description" },
    { from: "categoryRecId", to: "categoryId" },
    { from: "inactiveFlag", to: "inactiveFlag" },
    { from: "updatedBy", to: "updatedById" },
    { from: "enteredBy", to: "createdById" },
    { from: "lastUpdatedUtc", to: "updatedAt" },
    { from: "dateEnteredUtc", to: "createdAt" },
  ],
};
