import * as mongoose from "mongoose";
import { model, AggregatePaginateModel } from "mongoose";
const aggregatePaginate = require("mongoose-aggregate-paginate-v2");
const Schema = mongoose.Schema;

const ProductService = new Schema(
  {
    name: { type: String },
    image: { type: String },
    time: { type: Number },
    price: { type: Number },
    feature_list : { type: Array },
    // vehicle_make: { type: Schema.Types.ObjectId, ref: 'CarMake' },
    // vehicle_model: { type: Schema.Types.ObjectId, ref: 'CarModel' },
    vehicle_type: { type: Schema.Types.ObjectId, ref: 'CarType' },
    is_featured: {
        type: Boolean,
        default: false,
    },
    is_active: {
      type: Boolean,
      default: true,
    },
  },
  {
    timestamps: {
      createdAt: "created_at",
      updatedAt: "updated_at",
    },
  }
);

mongoose.plugin(aggregatePaginate);

export default model<any, AggregatePaginateModel<any>>("ProductService", ProductService);
