const mongoose = require('mongoose');

const employeeSchema = new mongoose.Schema(
  {
    employeeNumber: {
      type: String,
      required: true,
      unique: true,
      trim: true
    },
    firstName: { type: String, required: true, trim: true },
    lastName: { type: String, required: true, trim: true },
    address: { type: String, required: true, trim: true },
    position: { type: String, required: true, trim: true },
    telephone: { type: String, required: true, trim: true },
    gender: {
      type: String,
      required: true,
      enum: ['Male', 'Female', 'Other'],
      trim: true
    },
    hiredDate: { type: Date, required: true },
    department: { type: mongoose.Schema.Types.ObjectId, ref: 'Department', required: true }
  },
  { timestamps: true }
);

module.exports = mongoose.model('Employee', employeeSchema);

