coryas-formation-api/feature/contact/model/contact.model.js

42 lines
795 B
JavaScript
Raw Normal View History

2024-08-20 17:18:34 +00:00
const mongoose = require('mongoose');
const schema = new mongoose.Schema({
codeObject: String,
lastname: {
type: String,
require: true,
maxLength: 70,
minLength: 2,
default: ""
},
firstname: {
type: String,
require: true,
maxLength: 70,
default: ""
},
phone: {
type: String,
require: true,
maxLength: 20,
default: ""
},
mail: {
type: String,
require: true,
default: ""
},
vehicle: {
type: mongoose.Schema.ObjectId,
ref: 'vehicle'
},
status: String,
createdBy: {
type: String,
ref: 'user'
}
},
{
timestamps:true
})
module.exports= mongoose.model('contact',schema)