user.js 769 B

123456789101112131415161718192021222324252627282930313233
  1. module.exports = {
  2. username: { type: String, required: true },
  3. role: { type: String, default: 'default', required: true },
  4. email: {
  5. verified: { type: Boolean, default: false, required: true },
  6. verificationToken: String,
  7. address: String
  8. },
  9. services: {
  10. password: {
  11. password: String,
  12. reset: {
  13. code: { type: String, min: 8, max: 8 },
  14. expires: { type: Date }
  15. },
  16. set: {
  17. code: { type: String, min: 8, max: 8 },
  18. expires: { type: Date }
  19. }
  20. },
  21. github: {
  22. id: Number,
  23. access_token: String
  24. }
  25. },
  26. statistics: {
  27. songsRequested: { type: Number, default: 0, required: true }
  28. },
  29. liked: [{ type: String }],
  30. disliked: [{ type: String }],
  31. favoriteStations: [{ type: String }],
  32. createdAt: { type: Date, default: Date.now() }
  33. };