// Connections
import mongoConnection from "$connections/mongo/mongo.connection.js";

import mongoose from "mongoose";
const mongooseSchema = mongoose.Schema;

export const schemaModel = {
  user: {
    type: mongooseSchema.Types.ObjectId,
    ref: "User",
    required: true,
  },
  bio: {
    type: String,
    default: "",
  },
  avatar: {
    type: String,
    default: "",
  },
  settings: {
    type: Object,
    default: {},
  },
};

export const schema = new mongooseSchema(schemaModel, { timestamps: true });

export default mongoConnection.model("Profile", schema);
