52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
const mongoose = require('mongoose');
|
|
const Schema = mongoose.Schema;
|
|
|
|
const addressSchema = new Schema(
|
|
{
|
|
address: { type: String },
|
|
longitude: { type: String },
|
|
latitude: { type: String },
|
|
},
|
|
{ _id: false }
|
|
);
|
|
|
|
const GuidedWalkBookingSchema = new Schema({
|
|
|
|
time_slot: Date,
|
|
members_count: String,
|
|
booker_first_name: String,
|
|
booker_last_name: String,
|
|
email: String,
|
|
date: String,
|
|
pan_card: String,
|
|
start: String,
|
|
end: String,
|
|
telephone_number: String,
|
|
walk_id: {
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
ref: 'rpgwalklist'
|
|
},
|
|
user_id: {
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
ref: 'rpguserlist'
|
|
},
|
|
walk_address: String,
|
|
pickup_location: addressSchema,
|
|
amount: Number,
|
|
duration: String,
|
|
order_id: String,
|
|
payment_id: String,
|
|
ticket_pdf: String,
|
|
is_paid: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
created_at: {
|
|
type: Date,
|
|
default: Date.now
|
|
}
|
|
}, { versionKey: false });
|
|
|
|
const GuidedWalkBooking = mongoose.model('GuidedWalkBooking', GuidedWalkBookingSchema);
|
|
module.exports = GuidedWalkBooking;
|