const mongoose = require('mongoose');

const maintenanceSchema = new mongoose.Schema({
  vehicle: { type: mongoose.Schema.Types.ObjectId, ref: 'Vehicle', required: true },
  serviceType: { type: String, required: true },
  maintenanceCost: { type: Number, required: true },
  maintenanceDate: { type: Date, required: true },
  vehicleStatus: {
    type: String,
    enum: ['Available', 'Under Maintenance', 'Out Of Service'],
    required: true,
  },
}, { timestamps: true });

module.exports = mongoose.model('Maintenance', maintenanceSchema);
