import { Warehouse as CwWarehouse } from "../../generated/prisma/client";
import { Warehouse as ApiWarehouse } from "../../../api/generated/prisma/client";
import { Translation } from "./types";

export const warehouseTranslation: Translation<CwWarehouse, ApiWarehouse> = {
    values: [
        { from: "warehouseRecId", to: "id" },
        {
            from: "warehouseName",
            to: "name",
            process: (value) => (value ? value : "Unnamed Warehouse"),
        },
        {
            from: "inactiveFlag",
            to: "inactiveFlag",
            process: (value) => Boolean(value),
        },
        {
            from: "lockedFlag",
            to: "lockedFlag",
            process: (value) => Boolean(value),
        },
        { from: "updatedBy", to: "updatedById" },
        { from: "enteredBy", to: "createdById" },
        { from: "lastUpdatedUtc", to: "updatedAt" },
        { from: "dateEnteredUtc", to: "createdAt" },
    ],
};
