/***
 *
 * @description This model represent the gym workers collection schema in mongodb
 * * source : https://mongoosejs.com/docs/guide.html
 */
import mongoose, { Model } from 'mongoose';
import { IWorkersSchema } from '@/types/IDB';
// define the schema
const workersSchema = new mongoose.Schema<IWorkersSchema>({
    firstName: String,
    lastName: String,
    jobType: String,
    monthlySalary: String,
    gendre: String,
    phone: String,
    email: String,
    address: String,
}, { timestamps: true });
// export the model
const workerModel: Model<IWorkersSchema> = mongoose.models.workers || mongoose.model<IWorkersSchema>('workers', workersSchema);
export default workerModel