Spaces:
Sleeping
Sleeping
| const mongoose = require('mongoose'); | |
| const tripPlanSchema = new mongoose.Schema( | |
| { | |
| userId: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'User', | |
| required: true, | |
| }, | |
| destination: { | |
| type: String, | |
| required: true, | |
| }, | |
| startDate: { | |
| type: Date, | |
| required: true, | |
| }, | |
| endDate: { | |
| type: Date, | |
| required: true, | |
| }, | |
| groupSize: { | |
| type: Number, | |
| default: 1, | |
| }, | |
| eventType: { | |
| type: String, | |
| enum: ['vacation', 'wedding', 'honeymoon', 'family_trip', 'solo_travel', 'group_event', 'corporate'], | |
| default: 'vacation', | |
| }, | |
| budget: { | |
| type: Number, | |
| default: null, | |
| }, | |
| recommendedPhotographers: [ | |
| { | |
| photographerId: mongoose.Schema.Types.ObjectId, | |
| matchScore: Number, | |
| pricePerDay: Number, | |
| }, | |
| ], | |
| trendingSpots: [ | |
| { | |
| spotName: String, | |
| location: String, | |
| bestTime: String, | |
| description: String, | |
| photographersNearby: [mongoose.Schema.Types.ObjectId], | |
| }, | |
| ], | |
| itinerary: [ | |
| { | |
| day: Number, | |
| activities: [String], | |
| photoSpots: [String], | |
| notes: String, | |
| }, | |
| ], | |
| selectedPhotographer: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'Photographer', | |
| default: null, | |
| }, | |
| bookingDetails: { | |
| packageId: mongoose.Schema.Types.ObjectId, | |
| startTime: Date, | |
| endTime: Date, | |
| totalDays: Number, | |
| totalPrice: Number, | |
| }, | |
| status: { | |
| type: String, | |
| enum: ['planning', 'booked', 'completed', 'archived'], | |
| default: 'planning', | |
| }, | |
| sharedLink: { | |
| type: String, | |
| default: null, // shareable URL for trip plan | |
| }, | |
| notes: { | |
| type: String, | |
| default: '', | |
| }, | |
| createdAt: { | |
| type: Date, | |
| default: Date.now, | |
| }, | |
| }, | |
| { timestamps: true } | |
| ); | |
| module.exports = mongoose.model('TripPlan', tripPlanSchema); | |