42 lines
795 B
JavaScript
42 lines
795 B
JavaScript
|
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)
|