mirror of
https://github.com/Alvin-Zilverstand/challenge-11.git
synced 2026-03-06 11:06:21 +01:00
Remove index.html, styles.css, favicon.svg, script.js, and tailwind.config.js files to streamline the project and eliminate unused resources.
This commit is contained in:
34
models/Contact.js
Normal file
34
models/Contact.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
const contactSchema = new mongoose.Schema({
|
||||
customer: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: 'Customer',
|
||||
required: true
|
||||
},
|
||||
user: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: 'User',
|
||||
required: true
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
enum: ['phone', 'email', 'in-person', 'other'],
|
||||
required: true
|
||||
},
|
||||
notes: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
followUp: {
|
||||
required: Boolean,
|
||||
date: Date,
|
||||
notes: String
|
||||
},
|
||||
createdAt: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('Contact', contactSchema);
|
||||
Reference in New Issue
Block a user