import mongoose, { mongo } from "mongoose";

const voteSchema = new mongoose.Schema(
  {
    submittedBy: {
      type: mongoose.Schema.Types.ObjectId, // ObjectId that refers to WebsiteSubmission model
      ref: "User", // Reference to the User model
      required: true,
    },
    websiteId: {
      type: mongoose.Schema.Types.ObjectId, // ObjectId that refers to WebsiteSubmission model
      ref: "WebsiteSubmission", // Reference to the WebsiteSubmission model
      required: true,
    },
    design: {
      type: String,
      required: true,
    },
    usability: {
      type: String,
      required: true,
    },
    creativity: {
      type: String,
      required: true,
    },
    content: {
      type: String,
      required: true,
    },
    score: {
      type: Number,
      required: true,
    },
    overAllLabel: {
      type: String,
      required: true,
    },
  },
  { timestamps: true }
);

const Vote = mongoose.model("Vote", voteSchema);
export default Vote;
