var mongoose = require("mongoose");

const modelSchema = new mongoose.Schema(
  {
    responses: [
      {
        question: {
          type: mongoose.Schema.Types.ObjectId,
          ref: "Questions",
        },
        answer: String,
      },
    ],
    testResult: {
      leftEar: [],
      rightEar: [],
    },
    testGraph: String,
    guest: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "Guest",
    },
    user: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "Users",
    },
    company: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "Company",
    },
  },
  { timestamps: true }
);

const UserResponses = mongoose.model("UserResponses", modelSchema);
module.exports.UserResponses = UserResponses;
