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,
|
2024-08-21 18:33:32 +00:00
|
|
|
default: ''
|
2024-08-20 17:18:34 +00:00
|
|
|
},
|
|
|
|
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,
|
2024-08-22 11:09:30 +00:00
|
|
|
// createdBy: {
|
|
|
|
// type: String,
|
|
|
|
// ref: 'user'
|
|
|
|
// }
|
2024-08-20 17:18:34 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
timestamps:true
|
|
|
|
})
|
|
|
|
|
|
|
|
module.exports= mongoose.model('contact',schema)
|