All files / Zapcard_API/models email.js

100% Statements 4/4
100% Branches 0/0
100% Functions 0/0
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26      1x 1x       1x                               1x  
/**
* Module Dependencies
*/
const mongoose = require('mongoose');
require('mongoose-type-email');
/**
* Define the Database structure for Email (Schema)
*/
const EmailSchema = new mongoose.Schema({
  email: {
    type: mongoose.SchemaTypes.Email,
    required: true,
    trim: true,
  },
  createdBy: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'User',
    required: true,
  },
});
 
/**
* Make the Schema available in the app
*/
module.exports = mongoose.model('Email', EmailSchema);