- Initial commit... A DB, some routes, and basic authentication routines...
This commit is contained in:
29
models/common/phone.js
Normal file
29
models/common/phone.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const mongoose = require('mongoose');
|
||||
const mongooseStringQuery = require('mongoose-string-query');
|
||||
const mongooseTimestamps = require('mongoose-timestamp');
|
||||
|
||||
const PhoneSchema = new mongoose.Schema(
|
||||
{
|
||||
countryCode: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: '1',
|
||||
},
|
||||
number: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
required: true,
|
||||
enum: [ 'home', 'mobile' ],
|
||||
},
|
||||
},
|
||||
|
||||
{ minimize: false },
|
||||
);
|
||||
|
||||
PhoneSchema.plugin(mongooseStringQuery);
|
||||
PhoneSchema.plugin(mongooseTimestamps);
|
||||
|
||||
module.exports = PhoneSchema;
|
||||
Reference in New Issue
Block a user