Feedback.js 474 B

123456789101112131415161718192021222324
  1. const mongoose = require('../infrastructure/Mongoose')
  2. const { Schema } = mongoose
  3. const { ObjectId } = Schema
  4. const FeedbackSchema = new Schema(
  5. {
  6. userId: {
  7. type: ObjectId,
  8. ref: 'User',
  9. },
  10. source: String,
  11. createdAt: {
  12. type: Date,
  13. default() {
  14. return new Date()
  15. },
  16. },
  17. data: {},
  18. },
  19. { minimize: false }
  20. )
  21. exports.Feedback = mongoose.model('Feedback', FeedbackSchema)
  22. exports.FeedbackSchema = FeedbackSchema