const mongoose = require('mongoose');

const vehicleCategorySchema = new mongoose.Schema({
    categoryName: {
        type: String,
        required: [true, 'Category name is required'],
        unique: true,
        trim: true
    },
    defaultSeats: {
        type: Number,
        required: [true, 'Category seats is required']
    },
    description: {
        type: String,
        trim: true
    },
    status: {
        type: String,
        enum: ['active', 'inactive'],
        default: 'active',
        index: true
    },
    createdBy: {
        type: mongoose.Schema.Types.ObjectId,
        refPath: 'createdByModel'
    }
}, { timestamps: true });

module.exports = mongoose.model('VehicleCategory', vehicleCategorySchema);
