playov2-js-utilities 0.3.70 → 0.3.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -28
- package/index.js +4 -4
- package/lib/constants.js +20 -20
- package/lib/cron.js +43 -43
- package/lib/db/models/user.js +112 -0
- package/lib/db/mongo.js +3 -0
- package/lib/db_interface/mongo/index.js +5 -5
- package/lib/db_interface/mongo/schemas/activitySchemas/_activityIndex.js +10 -10
- package/lib/db_interface/mongo/schemas/activitySchemas/activityInsurance.js +17 -17
- package/lib/db_interface/mongo/schemas/activitySchemas/activityLocation.js +104 -104
- package/lib/db_interface/mongo/schemas/activitySchemas/activityQueryBlock.js +11 -11
- package/lib/db_interface/mongo/schemas/activitySchemas/activityView.js +13 -13
- package/lib/db_interface/mongo/schemas/activitySchemas/cronJobLog.js +12 -12
- package/lib/db_interface/mongo/schemas/activitySchemas/playogame.request.js +37 -37
- package/lib/db_interface/mongo/schemas/activitySchemas/scheduled.tasks.js +52 -52
- package/lib/db_interface/mongo/schemas/activitySchemas/userActivity.js +133 -133
- package/lib/db_interface/mongo/schemas/gamebookSchemas/_gamebookIndex.js +2 -2
- package/lib/db_interface/mongo/schemas/gamebookSchemas/activityNotes.js +19 -19
- package/lib/db_interface/mongo/schemas/gamebookSchemas/expense.js +36 -36
- package/lib/db_interface/mongo/schemas/gamebookSchemas/expenseLogs.js +13 -13
- package/lib/db_interface/mongo/schemas/gamebookSchemas/message.requests.js +29 -29
- package/lib/db_interface/mongo/schemas/gamebookSchemas/nonPlayoExpenseUsers.js +14 -14
- package/lib/db_interface/mongo/schemas/gamebookSchemas/playpals.js +69 -69
- package/lib/db_interface/mongo/schemas/gamebookSchemas/postActivity.js +51 -51
- package/lib/db_interface/mongo/schemas/gamebookSchemas/tags.js +12 -12
- package/lib/db_interface/mongo/schemas/userSchemas/QuickActions.js +25 -25
- package/lib/db_interface/mongo/schemas/userSchemas/_userIndex.js +7 -7
- package/lib/db_interface/mongo/schemas/userSchemas/blockedUser.js +11 -11
- package/lib/db_interface/mongo/schemas/userSchemas/city.js +62 -62
- package/lib/db_interface/mongo/schemas/userSchemas/country.js +63 -63
- package/lib/db_interface/mongo/schemas/userSchemas/emailOtp.js +12 -12
- package/lib/db_interface/mongo/schemas/userSchemas/emailVerificationToken.js +11 -11
- package/lib/db_interface/mongo/schemas/userSchemas/gt.trial.games.js +24 -24
- package/lib/db_interface/mongo/schemas/userSchemas/invite.js +14 -14
- package/lib/db_interface/mongo/schemas/userSchemas/karmaConfig.js +11 -11
- package/lib/db_interface/mongo/schemas/userSchemas/karmaLog.js +28 -28
- package/lib/db_interface/mongo/schemas/userSchemas/passwordResetToken.js +11 -11
- package/lib/db_interface/mongo/schemas/userSchemas/playo.subscription.pack.js +67 -67
- package/lib/db_interface/mongo/schemas/userSchemas/rankings.js +16 -16
- package/lib/db_interface/mongo/schemas/userSchemas/sports.js +26 -26
- package/lib/db_interface/mongo/schemas/userSchemas/sportsCategory.js +11 -11
- package/lib/db_interface/mongo/schemas/userSchemas/tempUser.js +35 -35
- package/lib/db_interface/mongo/schemas/userSchemas/trendingSports.js +14 -14
- package/lib/db_interface/mongo/schemas/userSchemas/user.activity.health.kit.data.js +26 -26
- package/lib/db_interface/mongo/schemas/userSchemas/user.contacts.js +33 -33
- package/lib/db_interface/mongo/schemas/userSchemas/user.js +111 -111
- package/lib/db_interface/mongo/schemas/userSchemas/userAlerts.js +23 -23
- package/lib/db_interface/mongo/schemas/userSchemas/userCredentials.js +50 -50
- package/lib/db_interface/mongo/schemas/userSchemas/userFavourites.js +81 -81
- package/lib/db_interface/mongo/schemas/userSchemas/userOtp.js +9 -9
- package/lib/db_interface/mongo/schemas/userSchemas/userReputation.js +21 -21
- package/lib/db_interface/mongo/schemas/userSchemas/userSocial.js +17 -17
- package/lib/db_interface/mongo/schemas/userSchemas/year.in.playo.js +51 -51
- package/lib/db_interface/mongo/schemas/venueSchemas/_venueIndex.js +3 -3
- package/lib/db_interface/mongo/schemas/venueSchemas/ameneties.js +9 -9
- package/lib/db_interface/mongo/schemas/venueSchemas/cityArea.js +45 -45
- package/lib/db_interface/mongo/schemas/venueSchemas/clubConstraints.js +17 -17
- package/lib/db_interface/mongo/schemas/venueSchemas/corporateOffer.js +17 -17
- package/lib/db_interface/mongo/schemas/venueSchemas/couponOffers.js +39 -39
- package/lib/db_interface/mongo/schemas/venueSchemas/gamebagMember.js +11 -11
- package/lib/db_interface/mongo/schemas/venueSchemas/offer.js +48 -48
- package/lib/db_interface/mongo/schemas/venueSchemas/thirdParty.js +12 -12
- package/lib/db_interface/mongo/schemas/venueSchemas/venue.js +134 -134
- package/lib/db_interface/mongo/schemas/venueSchemas/venueEnquires.js +22 -22
- package/lib/db_interface/mongo/schemas/venueSchemas/venueMembers.js +14 -14
- package/lib/db_interface/mongo/schemas/venueSchemas/venueRating.js +18 -18
- package/lib/index.js +22 -23
- package/lib/logger.js +115 -115
- package/lib/message_publisher/index.js +144 -144
- package/lib/middleware.js +46 -46
- package/lib/notification-templates.js +254 -254
- package/lib/notification.config.js +476 -476
- package/lib/playo.utils/playo.error.handler.js +23 -23
- package/lib/playo.utils/playo.http.handler.js +162 -162
- package/lib/playo.utils/playo.res.generator.js +58 -58
- package/lib/profanityFilter/profanityFilter.js +15 -16
- package/lib/profanityFilter/profanityWords.js +2 -2
- package/lib/ratings/index.js +95 -95
- package/lib/request.js +135 -135
- package/lib/responseHandler/responseHandler.js +52 -52
- package/lib/util.js +151 -151
- package/package.json +36 -36
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
const Schema = mongoose.Schema;
|
|
3
|
-
|
|
4
|
-
const offerSchema = new Schema({
|
|
5
|
-
id : {type : String, required : true, unique : true},
|
|
6
|
-
imageUrl: { type: String, required: true },
|
|
7
|
-
shareMsg: { type: String, required: true },
|
|
8
|
-
offerType: { type: String, required: true },
|
|
9
|
-
offerContent: { type: String, required: true },
|
|
10
|
-
coupon: { type: String, default: "" },
|
|
11
|
-
offerName: { type: String, required: true },
|
|
12
|
-
city: { type: String, required: true },
|
|
13
|
-
cityCode: { type: Number, default: 1 },
|
|
14
|
-
multiCity: { type: Boolean, default: false },
|
|
15
|
-
cityLat: { type: Number, default: null },
|
|
16
|
-
cityLng: { type: Number, default: null },
|
|
17
|
-
sports: String,
|
|
18
|
-
activeKey: { type: String, default: "" },
|
|
19
|
-
active: { type: Boolean, default: false },
|
|
20
|
-
expiry: { type: Date, default: null },
|
|
21
|
-
startDate: { type: Date, default: Date.now },
|
|
22
|
-
shareLink: { type: String, default: "" },
|
|
23
|
-
deferLink: { type: String, default: "" },
|
|
24
|
-
infoData: [{
|
|
25
|
-
_id: false,
|
|
26
|
-
howTo: { type: String, default: "" },
|
|
27
|
-
coupon: { type: String, default: "" },
|
|
28
|
-
type: { type: String, default: "" },
|
|
29
|
-
content: { type: String, default: "" },
|
|
30
|
-
validity: { type: String, default: "" },
|
|
31
|
-
action: { type: String, default: "" }
|
|
32
|
-
|
|
33
|
-
}],
|
|
34
|
-
terms: { type: String, default: "" },
|
|
35
|
-
countryCode: { type: String, default: "+91" },
|
|
36
|
-
createdTS: { type: Date, default: Date.now },
|
|
37
|
-
geoLocation : {
|
|
38
|
-
type : { type: String },
|
|
39
|
-
coordinates : []
|
|
40
|
-
},
|
|
41
|
-
venueId: [String]
|
|
42
|
-
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
offerSchema.index({ geoLocation: "2dsphere" })
|
|
46
|
-
// offerSchema.index({ expiry: 1 })
|
|
47
|
-
|
|
48
|
-
module.exports = mongoose.model('Offer', offerSchema);
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
const Schema = mongoose.Schema;
|
|
3
|
+
|
|
4
|
+
const offerSchema = new Schema({
|
|
5
|
+
id : {type : String, required : true, unique : true},
|
|
6
|
+
imageUrl: { type: String, required: true },
|
|
7
|
+
shareMsg: { type: String, required: true },
|
|
8
|
+
offerType: { type: String, required: true },
|
|
9
|
+
offerContent: { type: String, required: true },
|
|
10
|
+
coupon: { type: String, default: "" },
|
|
11
|
+
offerName: { type: String, required: true },
|
|
12
|
+
city: { type: String, required: true },
|
|
13
|
+
cityCode: { type: Number, default: 1 },
|
|
14
|
+
multiCity: { type: Boolean, default: false },
|
|
15
|
+
cityLat: { type: Number, default: null },
|
|
16
|
+
cityLng: { type: Number, default: null },
|
|
17
|
+
sports: String,
|
|
18
|
+
activeKey: { type: String, default: "" },
|
|
19
|
+
active: { type: Boolean, default: false },
|
|
20
|
+
expiry: { type: Date, default: null },
|
|
21
|
+
startDate: { type: Date, default: Date.now },
|
|
22
|
+
shareLink: { type: String, default: "" },
|
|
23
|
+
deferLink: { type: String, default: "" },
|
|
24
|
+
infoData: [{
|
|
25
|
+
_id: false,
|
|
26
|
+
howTo: { type: String, default: "" },
|
|
27
|
+
coupon: { type: String, default: "" },
|
|
28
|
+
type: { type: String, default: "" },
|
|
29
|
+
content: { type: String, default: "" },
|
|
30
|
+
validity: { type: String, default: "" },
|
|
31
|
+
action: { type: String, default: "" }
|
|
32
|
+
|
|
33
|
+
}],
|
|
34
|
+
terms: { type: String, default: "" },
|
|
35
|
+
countryCode: { type: String, default: "+91" },
|
|
36
|
+
createdTS: { type: Date, default: Date.now },
|
|
37
|
+
geoLocation : {
|
|
38
|
+
type : { type: String },
|
|
39
|
+
coordinates : []
|
|
40
|
+
},
|
|
41
|
+
venueId: [String]
|
|
42
|
+
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
offerSchema.index({ geoLocation: "2dsphere" })
|
|
46
|
+
// offerSchema.index({ expiry: 1 })
|
|
47
|
+
|
|
48
|
+
module.exports = mongoose.model('Offer', offerSchema);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const Mongoose = require("mongoose")
|
|
2
|
-
const Schema = Mongoose.Schema
|
|
3
|
-
|
|
4
|
-
const thirdPartySchema = new Schema(
|
|
5
|
-
{
|
|
6
|
-
domain:{type:String,required:true},
|
|
7
|
-
venueId:{type:String,required:true}
|
|
8
|
-
}
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
thirdPartySchema.index({domain:1})
|
|
12
|
-
|
|
1
|
+
const Mongoose = require("mongoose")
|
|
2
|
+
const Schema = Mongoose.Schema
|
|
3
|
+
|
|
4
|
+
const thirdPartySchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
domain:{type:String,required:true},
|
|
7
|
+
venueId:{type:String,required:true}
|
|
8
|
+
}
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
thirdPartySchema.index({domain:1})
|
|
12
|
+
|
|
13
13
|
module.exports = Mongoose.model("thirdParty",thirdPartySchema)
|
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
const Schema = mongoose.Schema;
|
|
3
|
-
|
|
4
|
-
const VenueSchema = new Schema({
|
|
5
|
-
id: { type: String, required: true, unique: true },
|
|
6
|
-
oldPlayoId: { type: String, default: "", required: true },
|
|
7
|
-
name: { type: String, required: true, validate: /[A-Za-z]/ },
|
|
8
|
-
timings: { type: String, required: true },
|
|
9
|
-
amenities: [], // { type : String, default : null }, // locker, washroom, rentAcc, parking, trainer, firstAid, beverage
|
|
10
|
-
addInfo: String,
|
|
11
|
-
geoLocation: {
|
|
12
|
-
type: { type: String },
|
|
13
|
-
coordinates: []
|
|
14
|
-
},
|
|
15
|
-
// placeId : { type : String, default : '' },
|
|
16
|
-
address: { type: String, required: true },
|
|
17
|
-
area: { type: String, required: true },
|
|
18
|
-
category: { type: Number, required: true, min: 0, max: 3 }, //0 - unverified, 1 - verified, 2 - partner, 3 - member
|
|
19
|
-
// relationSummary : String,
|
|
20
|
-
city: { type: String, required: true, validate: /[A-Za-z]/ },
|
|
21
|
-
cityCode: { type: Number, default: 1 },
|
|
22
|
-
country: { type: String, required: true, validate: /[A-Za-z]/ },
|
|
23
|
-
state: String,
|
|
24
|
-
zipCode: { type: String },
|
|
25
|
-
inquiryPhone: { type: String, default: '' },
|
|
26
|
-
inquiryType: { type: Number, default: -1 }, // -1 - No SMS, 0 - Only venue, 1 - Only user, 2 - Both (send to user is not enabled)
|
|
27
|
-
email: [],
|
|
28
|
-
phone: [],
|
|
29
|
-
sports: [],
|
|
30
|
-
avgRating: { type: Number, default: 0, min: 0, max: 5 },
|
|
31
|
-
ratingCount: { type: Number, default: 0 },
|
|
32
|
-
// restricted : { type : Number, default : 0, min : 0, max : 1 },
|
|
33
|
-
s3Folder: String,
|
|
34
|
-
// bookType : { type : Number }, // 0 - Book, 1 - Reserve, 2 - Member/Book, 3 - Ticketing, 4 - Regular
|
|
35
|
-
infoData: [{
|
|
36
|
-
_id: false,
|
|
37
|
-
key: { type: String, required: true },
|
|
38
|
-
value: { type: String, required: true },
|
|
39
|
-
displayType: { type: Number }, // call-1, inquire-2, book-3, buy-4, join-5, enroll-6, RSVP-7,
|
|
40
|
-
type: { type: Number }, // call-1, inquire-2, book-3, pass-4, webview_inapp-5, webview_outside_app-6, bulk-7
|
|
41
|
-
caption: { type: String },
|
|
42
|
-
content: { type: String },
|
|
43
|
-
bookType: { type: Number }, // 0 - Book, 1 - Reserve, 2 - Member/Book, 3 - Ticketing, 4 - Regular, 6 - Bulk
|
|
44
|
-
sportId: { type: String, default: "" },
|
|
45
|
-
moreData: [{
|
|
46
|
-
_id: false,
|
|
47
|
-
key: { type: String, required: true },
|
|
48
|
-
value: { type: String, required: true },
|
|
49
|
-
}],
|
|
50
|
-
}],
|
|
51
|
-
functionData: [{
|
|
52
|
-
_id: false,
|
|
53
|
-
displayType: { type: Number, required: true }, // call-1, inquire-2, book-3, buy-4, join-5, enroll-6, RSVP-7
|
|
54
|
-
type: { type: Number, required: true }, // call-1, inquire-2, book-3, pass-4, webview_inapp-5, webview_outside_app-6, bulk-7
|
|
55
|
-
caption: { type: String, required: true },
|
|
56
|
-
content: { type: String, default: "" },
|
|
57
|
-
priority: { type: Number, required: true },
|
|
58
|
-
bookType: { type: Number }, // 0 - Book, 1 - Reserve, 2 - Member/Book, 3 - Ticketing, 4 - Regular, 6 - Bulk
|
|
59
|
-
sportId: { type: String, default: "" },
|
|
60
|
-
popupText: { type: String, default: '' }
|
|
61
|
-
}],
|
|
62
|
-
keywords: [{
|
|
63
|
-
_id: false,
|
|
64
|
-
key: { type: String, required: true },
|
|
65
|
-
active: { type: Boolean, required: true }
|
|
66
|
-
}],
|
|
67
|
-
images: [{
|
|
68
|
-
_id: false,
|
|
69
|
-
url: { type: String }
|
|
70
|
-
}],
|
|
71
|
-
videos: {
|
|
72
|
-
type: [
|
|
73
|
-
{
|
|
74
|
-
_id: false,
|
|
75
|
-
videoUrl: { type: String },
|
|
76
|
-
thumbnail: { type: String },
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
default: []
|
|
80
|
-
},
|
|
81
|
-
coverImage: { type: String, default: "" },
|
|
82
|
-
logoImg: { type: String, default: "" },
|
|
83
|
-
mapImage: { type: String, default: "" },
|
|
84
|
-
tags: [
|
|
85
|
-
{ tagId: String, expiry: Date }
|
|
86
|
-
],
|
|
87
|
-
search: { type: String, default: "" },
|
|
88
|
-
// dateLimit : {type : Number, default : 14},
|
|
89
|
-
createdTS: { type: Date, default: Date.now },
|
|
90
|
-
modTS: { type: Date, default: Date.now },
|
|
91
|
-
sponsored: { type: String, default: "" },
|
|
92
|
-
bulkSponsored: { type: String, default: "" },
|
|
93
|
-
active: { type: Boolean, default: true },
|
|
94
|
-
// oldId : { type : String, default : ""},
|
|
95
|
-
activatedOn: Date,
|
|
96
|
-
sponsoredExpiry: Date,
|
|
97
|
-
bulkSponsoredExpiry: Date,
|
|
98
|
-
description: { type: String, default: "" },
|
|
99
|
-
members: { type: Boolean, default: false }, // if true, show only to users who are members of the venue
|
|
100
|
-
shareLink: { type: String, default: "" },
|
|
101
|
-
deferLink: { type: String, default: "" },
|
|
102
|
-
fullLink: { type: String, default: "" },
|
|
103
|
-
priority: { type: Number, default: null },
|
|
104
|
-
googleMapLink: { type: String, default: "" },
|
|
105
|
-
remarks: { type: String, default: "" },
|
|
106
|
-
website: { type: String },
|
|
107
|
-
sponsoredRadius: { type: Number, default: 0 },
|
|
108
|
-
isSafeAndHygiene: { type: Boolean, default: false },
|
|
109
|
-
bulkSponsoredRadius: { type: Number, default: 0 },
|
|
110
|
-
googlePlusCode: { type: String, default: "" },
|
|
111
|
-
products: [{
|
|
112
|
-
_id: false,
|
|
113
|
-
name: { type: String, required: true },
|
|
114
|
-
priority: { type: Number, default: 0 },
|
|
115
|
-
icon: { type: String, required: true },
|
|
116
|
-
info: { type: String, required: true },
|
|
117
|
-
url: { type: String, required: true },
|
|
118
|
-
type: { type: String, required: true } // 0 - gear, 1 - Beverage, 2 - food
|
|
119
|
-
}],
|
|
120
|
-
bnpl: { type: Boolean, default: false },
|
|
121
|
-
partialPay: { type: Boolean, default: false },
|
|
122
|
-
activityCount: { type: Number, default: 0 },
|
|
123
|
-
activityCountLastSyncDate: {type: Date, default: new Date()},
|
|
124
|
-
textSearchableField: [String]
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
VenueSchema.index({ geoLocation: "2dsphere" });
|
|
128
|
-
VenueSchema.index({ oldPlayoId: 1 });
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* keys to text index - textSearchableField, array containing texts on which search is going to take place
|
|
132
|
-
*/
|
|
133
|
-
|
|
134
|
-
module.exports = mongoose.model('Venue', VenueSchema);
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
const Schema = mongoose.Schema;
|
|
3
|
+
|
|
4
|
+
const VenueSchema = new Schema({
|
|
5
|
+
id: { type: String, required: true, unique: true },
|
|
6
|
+
oldPlayoId: { type: String, default: "", required: true },
|
|
7
|
+
name: { type: String, required: true, validate: /[A-Za-z]/ },
|
|
8
|
+
timings: { type: String, required: true },
|
|
9
|
+
amenities: [], // { type : String, default : null }, // locker, washroom, rentAcc, parking, trainer, firstAid, beverage
|
|
10
|
+
addInfo: String,
|
|
11
|
+
geoLocation: {
|
|
12
|
+
type: { type: String },
|
|
13
|
+
coordinates: []
|
|
14
|
+
},
|
|
15
|
+
// placeId : { type : String, default : '' },
|
|
16
|
+
address: { type: String, required: true },
|
|
17
|
+
area: { type: String, required: true },
|
|
18
|
+
category: { type: Number, required: true, min: 0, max: 3 }, //0 - unverified, 1 - verified, 2 - partner, 3 - member
|
|
19
|
+
// relationSummary : String,
|
|
20
|
+
city: { type: String, required: true, validate: /[A-Za-z]/ },
|
|
21
|
+
cityCode: { type: Number, default: 1 },
|
|
22
|
+
country: { type: String, required: true, validate: /[A-Za-z]/ },
|
|
23
|
+
state: String,
|
|
24
|
+
zipCode: { type: String },
|
|
25
|
+
inquiryPhone: { type: String, default: '' },
|
|
26
|
+
inquiryType: { type: Number, default: -1 }, // -1 - No SMS, 0 - Only venue, 1 - Only user, 2 - Both (send to user is not enabled)
|
|
27
|
+
email: [],
|
|
28
|
+
phone: [],
|
|
29
|
+
sports: [],
|
|
30
|
+
avgRating: { type: Number, default: 0, min: 0, max: 5 },
|
|
31
|
+
ratingCount: { type: Number, default: 0 },
|
|
32
|
+
// restricted : { type : Number, default : 0, min : 0, max : 1 },
|
|
33
|
+
s3Folder: String,
|
|
34
|
+
// bookType : { type : Number }, // 0 - Book, 1 - Reserve, 2 - Member/Book, 3 - Ticketing, 4 - Regular
|
|
35
|
+
infoData: [{
|
|
36
|
+
_id: false,
|
|
37
|
+
key: { type: String, required: true },
|
|
38
|
+
value: { type: String, required: true },
|
|
39
|
+
displayType: { type: Number }, // call-1, inquire-2, book-3, buy-4, join-5, enroll-6, RSVP-7,
|
|
40
|
+
type: { type: Number }, // call-1, inquire-2, book-3, pass-4, webview_inapp-5, webview_outside_app-6, bulk-7
|
|
41
|
+
caption: { type: String },
|
|
42
|
+
content: { type: String },
|
|
43
|
+
bookType: { type: Number }, // 0 - Book, 1 - Reserve, 2 - Member/Book, 3 - Ticketing, 4 - Regular, 6 - Bulk
|
|
44
|
+
sportId: { type: String, default: "" },
|
|
45
|
+
moreData: [{
|
|
46
|
+
_id: false,
|
|
47
|
+
key: { type: String, required: true },
|
|
48
|
+
value: { type: String, required: true },
|
|
49
|
+
}],
|
|
50
|
+
}],
|
|
51
|
+
functionData: [{
|
|
52
|
+
_id: false,
|
|
53
|
+
displayType: { type: Number, required: true }, // call-1, inquire-2, book-3, buy-4, join-5, enroll-6, RSVP-7
|
|
54
|
+
type: { type: Number, required: true }, // call-1, inquire-2, book-3, pass-4, webview_inapp-5, webview_outside_app-6, bulk-7
|
|
55
|
+
caption: { type: String, required: true },
|
|
56
|
+
content: { type: String, default: "" },
|
|
57
|
+
priority: { type: Number, required: true },
|
|
58
|
+
bookType: { type: Number }, // 0 - Book, 1 - Reserve, 2 - Member/Book, 3 - Ticketing, 4 - Regular, 6 - Bulk
|
|
59
|
+
sportId: { type: String, default: "" },
|
|
60
|
+
popupText: { type: String, default: '' }
|
|
61
|
+
}],
|
|
62
|
+
keywords: [{
|
|
63
|
+
_id: false,
|
|
64
|
+
key: { type: String, required: true },
|
|
65
|
+
active: { type: Boolean, required: true }
|
|
66
|
+
}],
|
|
67
|
+
images: [{
|
|
68
|
+
_id: false,
|
|
69
|
+
url: { type: String }
|
|
70
|
+
}],
|
|
71
|
+
videos: {
|
|
72
|
+
type: [
|
|
73
|
+
{
|
|
74
|
+
_id: false,
|
|
75
|
+
videoUrl: { type: String },
|
|
76
|
+
thumbnail: { type: String },
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
default: []
|
|
80
|
+
},
|
|
81
|
+
coverImage: { type: String, default: "" },
|
|
82
|
+
logoImg: { type: String, default: "" },
|
|
83
|
+
mapImage: { type: String, default: "" },
|
|
84
|
+
tags: [
|
|
85
|
+
{ tagId: String, expiry: Date }
|
|
86
|
+
],
|
|
87
|
+
search: { type: String, default: "" },
|
|
88
|
+
// dateLimit : {type : Number, default : 14},
|
|
89
|
+
createdTS: { type: Date, default: Date.now },
|
|
90
|
+
modTS: { type: Date, default: Date.now },
|
|
91
|
+
sponsored: { type: String, default: "" },
|
|
92
|
+
bulkSponsored: { type: String, default: "" },
|
|
93
|
+
active: { type: Boolean, default: true },
|
|
94
|
+
// oldId : { type : String, default : ""},
|
|
95
|
+
activatedOn: Date,
|
|
96
|
+
sponsoredExpiry: Date,
|
|
97
|
+
bulkSponsoredExpiry: Date,
|
|
98
|
+
description: { type: String, default: "" },
|
|
99
|
+
members: { type: Boolean, default: false }, // if true, show only to users who are members of the venue
|
|
100
|
+
shareLink: { type: String, default: "" },
|
|
101
|
+
deferLink: { type: String, default: "" },
|
|
102
|
+
fullLink: { type: String, default: "" },
|
|
103
|
+
priority: { type: Number, default: null },
|
|
104
|
+
googleMapLink: { type: String, default: "" },
|
|
105
|
+
remarks: { type: String, default: "" },
|
|
106
|
+
website: { type: String },
|
|
107
|
+
sponsoredRadius: { type: Number, default: 0 },
|
|
108
|
+
isSafeAndHygiene: { type: Boolean, default: false },
|
|
109
|
+
bulkSponsoredRadius: { type: Number, default: 0 },
|
|
110
|
+
googlePlusCode: { type: String, default: "" },
|
|
111
|
+
products: [{
|
|
112
|
+
_id: false,
|
|
113
|
+
name: { type: String, required: true },
|
|
114
|
+
priority: { type: Number, default: 0 },
|
|
115
|
+
icon: { type: String, required: true },
|
|
116
|
+
info: { type: String, required: true },
|
|
117
|
+
url: { type: String, required: true },
|
|
118
|
+
type: { type: String, required: true } // 0 - gear, 1 - Beverage, 2 - food
|
|
119
|
+
}],
|
|
120
|
+
bnpl: { type: Boolean, default: false },
|
|
121
|
+
partialPay: { type: Boolean, default: false },
|
|
122
|
+
activityCount: { type: Number, default: 0 },
|
|
123
|
+
activityCountLastSyncDate: {type: Date, default: new Date()},
|
|
124
|
+
textSearchableField: [String]
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
VenueSchema.index({ geoLocation: "2dsphere" });
|
|
128
|
+
VenueSchema.index({ oldPlayoId: 1 });
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* keys to text index - textSearchableField, array containing texts on which search is going to take place
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
module.exports = mongoose.model('Venue', VenueSchema);
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var mongoose = require('mongoose');
|
|
2
|
-
var Schema = mongoose.Schema;
|
|
3
|
-
|
|
4
|
-
var VenueEnquirySchema = new Schema({
|
|
5
|
-
|
|
6
|
-
userId: { type: String },
|
|
7
|
-
venueId: { type: String, required: true },
|
|
8
|
-
mobile: { type: String },
|
|
9
|
-
email: { type: String },
|
|
10
|
-
name: { type: String },
|
|
11
|
-
createdTS: { type: Date, default: Date.now },
|
|
12
|
-
comments: [{
|
|
13
|
-
_id: false,
|
|
14
|
-
msg: { type: String, required: true },
|
|
15
|
-
createdBY: { type: String, default: 'user' },
|
|
16
|
-
createdTS: { type: Date, default: Date.now }
|
|
17
|
-
}],
|
|
18
|
-
resolved: { type: Boolean, default: false },
|
|
19
|
-
inquiryType: { type: String, default: '' },
|
|
20
|
-
inquiryText: { type: String, default: '' }
|
|
21
|
-
});
|
|
22
|
-
|
|
1
|
+
var mongoose = require('mongoose');
|
|
2
|
+
var Schema = mongoose.Schema;
|
|
3
|
+
|
|
4
|
+
var VenueEnquirySchema = new Schema({
|
|
5
|
+
|
|
6
|
+
userId: { type: String },
|
|
7
|
+
venueId: { type: String, required: true },
|
|
8
|
+
mobile: { type: String },
|
|
9
|
+
email: { type: String },
|
|
10
|
+
name: { type: String },
|
|
11
|
+
createdTS: { type: Date, default: Date.now },
|
|
12
|
+
comments: [{
|
|
13
|
+
_id: false,
|
|
14
|
+
msg: { type: String, required: true },
|
|
15
|
+
createdBY: { type: String, default: 'user' },
|
|
16
|
+
createdTS: { type: Date, default: Date.now }
|
|
17
|
+
}],
|
|
18
|
+
resolved: { type: Boolean, default: false },
|
|
19
|
+
inquiryType: { type: String, default: '' },
|
|
20
|
+
inquiryText: { type: String, default: '' }
|
|
21
|
+
});
|
|
22
|
+
|
|
23
23
|
module.exports = mongoose.model('VenueEnquiry', VenueEnquirySchema);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
const Schema = mongoose.Schema;
|
|
3
|
-
|
|
4
|
-
const VenueMemberSchema = new Schema({
|
|
5
|
-
|
|
6
|
-
venueId: {type : String, required: true, unique: true},
|
|
7
|
-
members: [{
|
|
8
|
-
_id: false,
|
|
9
|
-
userId: String,
|
|
10
|
-
}],
|
|
11
|
-
createdTS: { type: Date, default: Date.now },
|
|
12
|
-
modTS: { type: Date, default: Date.now }
|
|
13
|
-
});
|
|
14
|
-
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
const Schema = mongoose.Schema;
|
|
3
|
+
|
|
4
|
+
const VenueMemberSchema = new Schema({
|
|
5
|
+
|
|
6
|
+
venueId: {type : String, required: true, unique: true},
|
|
7
|
+
members: [{
|
|
8
|
+
_id: false,
|
|
9
|
+
userId: String,
|
|
10
|
+
}],
|
|
11
|
+
createdTS: { type: Date, default: Date.now },
|
|
12
|
+
modTS: { type: Date, default: Date.now }
|
|
13
|
+
});
|
|
14
|
+
|
|
15
15
|
module.exports = mongoose.model('VenueMember', VenueMemberSchema);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
const Schema = mongoose.Schema;
|
|
3
|
-
|
|
4
|
-
const VenueRatingSchema = new Schema({
|
|
5
|
-
venueId: {type : String, required: true, unique: true},
|
|
6
|
-
ratings: [{
|
|
7
|
-
_id: false,
|
|
8
|
-
userId: String,
|
|
9
|
-
rating: { type: Number, min: 1, max: 5 },
|
|
10
|
-
remarks: { type: String, default: '' },
|
|
11
|
-
oldRatings: [],
|
|
12
|
-
ratedOn: Date
|
|
13
|
-
}],
|
|
14
|
-
createdTS: { type: Date, default: Date.now },
|
|
15
|
-
modTS: { type: Date, default: Date.now }
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
module.exports = mongoose.model('VenueRating', VenueRatingSchema);
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
const Schema = mongoose.Schema;
|
|
3
|
+
|
|
4
|
+
const VenueRatingSchema = new Schema({
|
|
5
|
+
venueId: {type : String, required: true, unique: true},
|
|
6
|
+
ratings: [{
|
|
7
|
+
_id: false,
|
|
8
|
+
userId: String,
|
|
9
|
+
rating: { type: Number, min: 1, max: 5 },
|
|
10
|
+
remarks: { type: String, default: '' },
|
|
11
|
+
oldRatings: [],
|
|
12
|
+
ratedOn: Date
|
|
13
|
+
}],
|
|
14
|
+
createdTS: { type: Date, default: Date.now },
|
|
15
|
+
modTS: { type: Date, default: Date.now }
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
module.exports = mongoose.model('VenueRating', VenueRatingSchema);
|
package/lib/index.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* This repo should be
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* Naming terminology - While exporting constants use PascalCase while exporting functions/methods use camelCase
|
|
3
|
+
* This repo should be used as a library for all the common functionalities that are used across the services.
|
|
4
|
+
* This repo should be privatized, no idea why it was public in the first place :(
|
|
5
|
+
*/
|
|
6
|
+
module.exports = {
|
|
7
|
+
ratings: require("./ratings/index"),
|
|
8
|
+
Constants: require("./constants"),
|
|
9
|
+
playoUtils: require("./util"),
|
|
10
|
+
NotificationTemplates: require("./notification-templates"),
|
|
11
|
+
NotificationConfig: require("./notification.config"),
|
|
12
|
+
httpRequest: require("./request"),
|
|
13
|
+
Cron: require("./cron"),
|
|
14
|
+
MessagePublisher: require("./message_publisher"),
|
|
15
|
+
middleware: require("./middleware"),
|
|
16
|
+
profanityFilter: require("./profanityFilter/profanityFilter"),
|
|
17
|
+
playoResponseHandler: require("./responseHandler/responseHandler"),
|
|
18
|
+
PLAYO_ERROR_HANDLER: require("./playo.utils/playo.error.handler"),
|
|
19
|
+
PLAYO_HTTP_HANDLER: require("./playo.utils/playo.http.handler"),
|
|
20
|
+
PLAYO_RESPONSE_GENERATOR: require("./playo.utils/playo.res.generator"),
|
|
21
|
+
PLAYO_MONGO_MODELS: require("./db_interface/mongo/index"),
|
|
22
|
+
};
|