23 lines
578 B
JavaScript
23 lines
578 B
JavaScript
module.exports = (mongoose) => {
|
|
var schema = mongoose.Schema(
|
|
{
|
|
employee: String,
|
|
finger_print: String,
|
|
finger_print_time: Date,
|
|
create_date: Date,
|
|
create_by: String,
|
|
update_date: Date,
|
|
update_by: String,
|
|
note: String,
|
|
site: Number
|
|
},
|
|
{ collection: 'fingerprint_attendance', timestamps: true }
|
|
);
|
|
schema.method("toJSON", function() {
|
|
const { __v, _id, ...object } = this.toObject();
|
|
object.id = _id;
|
|
return object;
|
|
});
|
|
const FingerprintAttendance = mongoose.model("fingerprint_attendance", schema);
|
|
return FingerprintAttendance;
|
|
};
|