const mongoose = require('mongoose')



const adminSchema = new mongoose.Schema({
 
  phone: {
    type: String,
    required: true,
    //unique: true,
  },

  username: {
    type: String,
    required: true,
   // unique: true,
  },
  password: {
    type: String,
    required: true
  },
  role: {
    type: String,
    enum: ['admin', 'sales', 'store'],
    default: 'sales',
  },
  customerId: {
    type: String,
    required: true,  // Customer ID is now required
    unique: true,
  },
  date: {
    type: Date,
    default: Date.now,
  },
})

const Admin = mongoose.model('Admin', adminSchema)

module.exports = Admin