import ModelName from "@/constants/dbEnum";
import { Schema } from "mongoose";
import UserSchemaMap from "./User";
import MessageSchemaMap from "./Message";

const schemaMap = {
  ...UserSchemaMap,
  ...MessageSchemaMap,
};

export default function getSchemaByModelName(modelName: ModelName): Schema {
  return schemaMap[modelName];
}
