import { Schema, model } from "mongoose";

const projectSchema = new Schema(
  {
    name: {
      type: String,
      required: true,
    },
    company: {
      type: String,
      required: true,
    },
    city: {
      type: String,
      required: true,
    },
    image: {
      type: String,
      required: true,
    },
    stage: {
      type: Number,
      default: 1,
    },
    releaseDate: {
      type: Date,
      required: true,
    },
    devices: {
      type: Array,
    },
  },
  {
    timestamps: true,
    toJSON: { virtuals: true },
    toObject: { virtuals: true },
  }
);

const Project = model("Project", projectSchema);

export default Project;
