You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.0 KiB

7 years ago
  1. var mongoose = require('mongoose'),
  2. Schema = mongoose.Schema;
  3. var travelSchema = new Schema({
  4. title: { type: String, required: true },
  5. description: { type: String },
  6. user: {
  7. type: mongoose.Schema.Types.ObjectId,
  8. ref: 'userModel'
  9. },
  10. from: { type: String, required: true },
  11. to: { type: String, required: true },
  12. date: { type: Date },
  13. periodic: { type: Boolean },
  14. generateddate: { type: Date },
  15. seats: { type: Number, required: true },
  16. package: { type: Boolean },
  17. collectivized: { type: Boolean },
  18. type: { type: String }, //if is an offering travel or asking for travel
  19. joins: [{
  20. type: mongoose.Schema.Types.ObjectId,
  21. ref: 'userModel'
  22. }],
  23. joinPetitions: [{
  24. type: mongoose.Schema.Types.ObjectId,
  25. ref: 'userModel'
  26. }],
  27. comments: [{
  28. type: mongoose.Schema.Types.ObjectId,
  29. ref: 'commentModel'
  30. }]
  31. })
  32. module.exports = mongoose.model('travelModel', travelSchema);
  33. //modality can be: offering, asking, package