worldshine-redesign/app/models/attendance-note.model.js
2025-07-04 14:13:25 -04:00

40 lines
1.0 KiB
JavaScript

module.exports = mongoose => {
var schema = mongoose.Schema(
{
slogan: {
type: String,
required: true
},
introduction: {
type: String,
required: true
},
image: {
type: String
},
status: {
type: String,
default: 'active'
},
site: Number,
create_date: {
type: Date,
default: Date.now
},
create_by: String,
update_date: {
type: Date,
default: Date.now
},
update_by: String
},
{ collection: 'attendance_note', timestamps: true }
);
schema.method("toJSON", function() {
const { __v, _id, ...object } = this.toObject();
object.id = _id;
return object;
});
const AttendanceNote = mongoose.model("attendance_note", schema);
return AttendanceNote;
};