Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. /*jshint esversion: 6 */
  2. const mongoose = require('mongoose'),
  3. passportLocalMongoose = require('passport-local-mongoose');
  4.  
  5. let UserSchema = new mongoose.Schema({
  6. firstName: String,
  7. lastName: String,
  8. aliasFirstName: String,
  9. aliasLastName: String,
  10. username: String,
  11. phone: String,
  12. password: String,
  13. isAdmin: Boolean,
  14. addressLine1: String,
  15. addressLine2: String,
  16. city: String,
  17. state: String,
  18. zipCode: Number,
  19. profilePic: {
  20. type: String,
  21. default: 'https://s.gravatar.com/avatar/0a07df079fd7a07e4cd0e5668835296c?s=80'
  22. },
  23. preferredPaymentMethod: {
  24. type: String,
  25. enum: ['', 'paypal', 'check', 'deposit'],
  26. default: ''
  27. },
  28. paymentPreference: {
  29. paypal: {
  30. email: {
  31. type: String,
  32. default: ''
  33. }
  34. },
  35. check: {
  36. addressLine1: {
  37. type: String,
  38. default: ''
  39. },
  40. addressLine2: {
  41. type: String,
  42. default: ''
  43. },
  44. city: {
  45. type: String,
  46. default: ''
  47. },
  48. state: {
  49. type: String,
  50. default: ''
  51. },
  52. zipCode: {
  53. type: Number,
  54. default: ''
  55. }
  56. },
  57. deposit: {
  58. routingOrTransit: {
  59. type: String,
  60. default: ''
  61. },
  62. accountNumber: {
  63. type: String,
  64. default: ''
  65. }
  66. },
  67. default: ''
  68. },
  69. lastLoginDate: {
  70. type: Date,
  71. default: Date.now
  72. }
  73. });
  74.  
  75. UserSchema.plugin(passportLocalMongoose);
  76.  
  77. module.exports = mongoose.model('User', UserSchema);
  78.  
  79. { _id: 5869ea79fd5c54171e2fa9f3,
  80. firstName: 'Joseph',
  81. lastName: 'Chambers',
  82. username: 'joseph@michael-chambers.com',
  83. __v: 0,
  84. aliasFirstName: 'Swift',
  85. aliasLastName: 'Nomad',
  86. phone: '',
  87. addressLine1: '',
  88. addressLine2: '',
  89. city: '',
  90. state: '',
  91. zipCode: null,
  92. lastLoginDate: 2017-01-02T05:51:53.045Z,
  93. paymentPreference: '',
  94. preferredPaymentMethod: 'paypal',
  95. profilePic: 'https://s.gravatar.com/avatar/0a07df079fd7a07e4cd0e5668835296c?s=80' }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement