Spaces:
Runtime error
Runtime error
Download src/models/Employee.js from yeshwanth-kr/dss-server: direct link, hf CLI and curl.
- Browser
- Download file 1.63 kB
-
https://huggingface.co/spaces/yeshwanth-kr/dss-server/resolve/main/src/models/Employee.js
- Command line
-
hf download hf://spaces/yeshwanth-kr/dss-server/src/models/Employee.js
-
curl -L -o Employee.js https://huggingface.co/spaces/yeshwanth-kr/dss-server/resolve/main/src/models/Employee.js
1.63 kB
| const { mongoose, baseSchemaOptions } = require('./base'); | |
| const EmployeeSchema = new mongoose.Schema({ | |
| vendor_id: { type: mongoose.Schema.Types.ObjectId, ref: 'Vendor', required: true }, | |
| employee_code: { type: String, trim: true }, | |
| name: { type: String, required: true, trim: true }, | |
| aadhar_no: { type: String, required: true, trim: true }, | |
| designation: { type: String, default: null, trim: true }, | |
| department: { type: String, default: null, trim: true }, | |
| contact_number: { type: String, default: null, trim: true }, | |
| uan_no: { type: String, default: null, trim: true }, | |
| esi_no: { type: String, default: null, trim: true }, | |
| bank_ifsc_code: { type: String, default: null, trim: true }, | |
| bank_account_number: { type: String, default: null, trim: true }, | |
| vehicle_no: { type: String, default: null, trim: true }, | |
| vehicle_type: { type: String, default: null, trim: true }, | |
| profile_photo_path: { type: String, default: null }, | |
| status: { type: String, enum: ['Pending', 'HR_Approved', 'Safety_Approved', 'Active', 'Rejected'], default: 'Pending' }, | |
| hr_approved_at: { type: Date, default: null }, | |
| safety_completed_at: { type: Date, default: null }, | |
| due_date: { type: Date, default: null }, | |
| is_active: { type: Boolean, default: true } | |
| }, baseSchemaOptions()); | |
| EmployeeSchema.index({ vendor_id: 1, aadhar_no: 1 }, { unique: true }); | |
| EmployeeSchema.index({ employee_code: 1 }, { unique: true, sparse: true }); | |
| EmployeeSchema.index({ vendor_id: 1, employee_code: 1 }, { unique: true, sparse: true }); | |
| EmployeeSchema.index({ status: 1 }); | |
| module.exports = mongoose.model('Employee', EmployeeSchema); | |