Feedback.js 421 B

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