Spaces:
Sleeping
Sleeping
File size: 1,964 Bytes
0f8617c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | 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);
|