playov2-js-utilities 0.3.69 → 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 +14 -14
- 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
package/README.md
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# README #
|
|
2
|
-
|
|
3
|
-
This README would normally document whatever steps are necessary to get your application up and running.
|
|
4
|
-
|
|
5
|
-
### What is this repository for? ###
|
|
6
|
-
|
|
7
|
-
* Quick summary
|
|
8
|
-
* Version
|
|
9
|
-
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
|
|
10
|
-
|
|
11
|
-
### How do I get set up? ###
|
|
12
|
-
|
|
13
|
-
* Summary of set up
|
|
14
|
-
* Configuration
|
|
15
|
-
* Dependencies
|
|
16
|
-
* Database configuration
|
|
17
|
-
* How to run tests
|
|
18
|
-
* Deployment instructions
|
|
19
|
-
|
|
20
|
-
### Contribution guidelines ###
|
|
21
|
-
|
|
22
|
-
* Writing tests
|
|
23
|
-
* Code review
|
|
24
|
-
* Other guidelines
|
|
25
|
-
|
|
26
|
-
### Who do I talk to? ###
|
|
27
|
-
|
|
28
|
-
* Repo owner or admin
|
|
1
|
+
# README #
|
|
2
|
+
|
|
3
|
+
This README would normally document whatever steps are necessary to get your application up and running.
|
|
4
|
+
|
|
5
|
+
### What is this repository for? ###
|
|
6
|
+
|
|
7
|
+
* Quick summary
|
|
8
|
+
* Version
|
|
9
|
+
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
|
|
10
|
+
|
|
11
|
+
### How do I get set up? ###
|
|
12
|
+
|
|
13
|
+
* Summary of set up
|
|
14
|
+
* Configuration
|
|
15
|
+
* Dependencies
|
|
16
|
+
* Database configuration
|
|
17
|
+
* How to run tests
|
|
18
|
+
* Deployment instructions
|
|
19
|
+
|
|
20
|
+
### Contribution guidelines ###
|
|
21
|
+
|
|
22
|
+
* Writing tests
|
|
23
|
+
* Code review
|
|
24
|
+
* Other guidelines
|
|
25
|
+
|
|
26
|
+
### Who do I talk to? ###
|
|
27
|
+
|
|
28
|
+
* Repo owner or admin
|
|
29
29
|
* Other community or team contact
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// This will expose all the functionalities as a common interface
|
|
2
|
-
// Todo - Type definitions
|
|
3
|
-
|
|
4
|
-
module.exports = require('./lib');
|
|
1
|
+
// This will expose all the functionalities as a common interface
|
|
2
|
+
// Todo - Type definitions
|
|
3
|
+
|
|
4
|
+
module.exports = require('./lib');
|
package/lib/constants.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
const USER_INDIVIDUAL_RATINGS = Object.freeze({
|
|
3
|
-
1: "Beginner",
|
|
4
|
-
2: "Amateur",
|
|
5
|
-
3: "Intermediate",
|
|
6
|
-
4: "Advanced",
|
|
7
|
-
5: "professional"
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const RATINGS_WEIGHTAGE = Object.freeze({
|
|
11
|
-
'new': 0.9,
|
|
12
|
-
'old': 0.1
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const DEFAULT_TIME_ZONE = 'Asia/Kolkata';
|
|
16
|
-
|
|
17
|
-
module.exports = {
|
|
18
|
-
USER_INDIVIDUAL_RATINGS,
|
|
19
|
-
RATINGS_WEIGHTAGE,
|
|
20
|
-
DEFAULT_TIME_ZONE
|
|
1
|
+
|
|
2
|
+
const USER_INDIVIDUAL_RATINGS = Object.freeze({
|
|
3
|
+
1: "Beginner",
|
|
4
|
+
2: "Amateur",
|
|
5
|
+
3: "Intermediate",
|
|
6
|
+
4: "Advanced",
|
|
7
|
+
5: "professional"
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const RATINGS_WEIGHTAGE = Object.freeze({
|
|
11
|
+
'new': 0.9,
|
|
12
|
+
'old': 0.1
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const DEFAULT_TIME_ZONE = 'Asia/Kolkata';
|
|
16
|
+
|
|
17
|
+
module.exports = {
|
|
18
|
+
USER_INDIVIDUAL_RATINGS,
|
|
19
|
+
RATINGS_WEIGHTAGE,
|
|
20
|
+
DEFAULT_TIME_ZONE
|
|
21
21
|
}
|
package/lib/cron.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file will have all cron related utilities - (e.g. - schedulers etc.).
|
|
3
|
-
* Try to contain service common utilities here.
|
|
4
|
-
*/
|
|
5
|
-
const Constants = require('./constants');
|
|
6
|
-
const { CronJob } = require('cron');
|
|
7
|
-
const Utils = require('./util')
|
|
8
|
-
|
|
9
|
-
const cronner = (
|
|
10
|
-
cronTime,
|
|
11
|
-
onTime = Utils.noop,
|
|
12
|
-
onComplete = Utils.noop,
|
|
13
|
-
timeZone = Constants.DEFAULT_TIME_ZONE,
|
|
14
|
-
context = this,
|
|
15
|
-
runOnInit,
|
|
16
|
-
utcOffset,
|
|
17
|
-
) => {
|
|
18
|
-
const job = new CronJob({
|
|
19
|
-
cronTime,
|
|
20
|
-
// when the time specified by pattern is matched
|
|
21
|
-
onTick: onTime,
|
|
22
|
-
// onComplete
|
|
23
|
-
onComplete,
|
|
24
|
-
// whether the cron should start on constructor invoke (or whether .start() needs to be called)
|
|
25
|
-
start: false,
|
|
26
|
-
// timezone -> defaults to Asia/Kolkata
|
|
27
|
-
timeZone,
|
|
28
|
-
// the context to bind the onTime method to
|
|
29
|
-
context,
|
|
30
|
-
// flat to start cron on invocation of the module
|
|
31
|
-
runOnInit,
|
|
32
|
-
// the utc offset to run the cron at
|
|
33
|
-
utcOffset
|
|
34
|
-
});
|
|
35
|
-
job.start();
|
|
36
|
-
return job;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
module.exports = {
|
|
40
|
-
cronner
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This file will have all cron related utilities - (e.g. - schedulers etc.).
|
|
3
|
+
* Try to contain service common utilities here.
|
|
4
|
+
*/
|
|
5
|
+
const Constants = require('./constants');
|
|
6
|
+
const { CronJob } = require('cron');
|
|
7
|
+
const Utils = require('./util')
|
|
8
|
+
|
|
9
|
+
const cronner = (
|
|
10
|
+
cronTime,
|
|
11
|
+
onTime = Utils.noop,
|
|
12
|
+
onComplete = Utils.noop,
|
|
13
|
+
timeZone = Constants.DEFAULT_TIME_ZONE,
|
|
14
|
+
context = this,
|
|
15
|
+
runOnInit,
|
|
16
|
+
utcOffset,
|
|
17
|
+
) => {
|
|
18
|
+
const job = new CronJob({
|
|
19
|
+
cronTime,
|
|
20
|
+
// when the time specified by pattern is matched
|
|
21
|
+
onTick: onTime,
|
|
22
|
+
// onComplete
|
|
23
|
+
onComplete,
|
|
24
|
+
// whether the cron should start on constructor invoke (or whether .start() needs to be called)
|
|
25
|
+
start: false,
|
|
26
|
+
// timezone -> defaults to Asia/Kolkata
|
|
27
|
+
timeZone,
|
|
28
|
+
// the context to bind the onTime method to
|
|
29
|
+
context,
|
|
30
|
+
// flat to start cron on invocation of the module
|
|
31
|
+
runOnInit,
|
|
32
|
+
// the utc offset to run the cron at
|
|
33
|
+
utcOffset
|
|
34
|
+
});
|
|
35
|
+
job.start();
|
|
36
|
+
return job;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
module.exports = {
|
|
40
|
+
cronner
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
const Schema = mongoose.Schema;
|
|
3
|
+
|
|
4
|
+
const userSchema = new Schema({
|
|
5
|
+
id: { type: String, required: true, unique: true },
|
|
6
|
+
fName: { type: String, default: "" },
|
|
7
|
+
lName: { type: String, default: "" },
|
|
8
|
+
userName: {type: String, default: ""},
|
|
9
|
+
email: { type: String, primary: true, default: "" },
|
|
10
|
+
officialEmail: { type: String, required: false },
|
|
11
|
+
mobile: { type: String, default: "" },
|
|
12
|
+
oldPlayoId: { type: String, default: "" },
|
|
13
|
+
lastActiveAreaName: { type: String, default: "" },
|
|
14
|
+
active: { type: Date, default: Date.now },
|
|
15
|
+
phoneCountryCode: { type: String, default: "" },
|
|
16
|
+
countryCode: { type: String, default: "" },
|
|
17
|
+
cityCode: { type: Number, default: 1 },
|
|
18
|
+
profilePicUrl: { type: String, default: "" },
|
|
19
|
+
gender: { type: Number, default: 2, min: 0, max: 3 }, // 0-female , 1-male, 2-does not matter;3-others
|
|
20
|
+
karma: { type: Number, default: 0 },
|
|
21
|
+
karmaRedeem: { type: Number, default: 0 },
|
|
22
|
+
city: { type: String, default: "" },
|
|
23
|
+
geoLocation: {
|
|
24
|
+
type: { type: String, enum: ['Point'], default: 'Point' },
|
|
25
|
+
coordinates: {
|
|
26
|
+
type : [Number], default: [0, 0]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
geoLocationCity: {
|
|
30
|
+
type: { type: String },
|
|
31
|
+
coordinates: []
|
|
32
|
+
},
|
|
33
|
+
bio: { type: String, default: "" },
|
|
34
|
+
palsCount: Number,
|
|
35
|
+
emailVerified: { type: Boolean, default: false },
|
|
36
|
+
officialEmailVerified: { type: Boolean, default: false },
|
|
37
|
+
verified: { type: Boolean, default: false },
|
|
38
|
+
reportCount: Number,
|
|
39
|
+
superUser: { type: Boolean, default: false },
|
|
40
|
+
venueId: { type: String, default: "" },
|
|
41
|
+
rules: { type: String, default: "" },
|
|
42
|
+
messages: [ // for notifications
|
|
43
|
+
{
|
|
44
|
+
key: String,
|
|
45
|
+
value: String
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
isOnApplozic: { type: Boolean, default: false },
|
|
49
|
+
lastPlayed: { type: Date, default: null },
|
|
50
|
+
helpTS: { type: Date, default: Date.now },
|
|
51
|
+
deviceType: { type: Number, default: -1 }, //11-ios, 0-android - 11 is correct for ios
|
|
52
|
+
deviceModel: { type: String, default: "" },
|
|
53
|
+
gcmRegId: [],
|
|
54
|
+
iosRegId: [],
|
|
55
|
+
iosBadge: { type: Number, default: 0 },
|
|
56
|
+
version: { type: Number, default: 0 },
|
|
57
|
+
onesignalId: [],
|
|
58
|
+
shareLink: { type: String, default: "" },
|
|
59
|
+
deferLink: { type: String, default: "" },
|
|
60
|
+
chatStatus: { type: Number, default: 0 },
|
|
61
|
+
fullLink: { type: String, default: "" },
|
|
62
|
+
referralLink: { type: String, default: null },
|
|
63
|
+
lastResetOn: { type: Date, default: null },
|
|
64
|
+
oldEmail: { type: String, default: "" },
|
|
65
|
+
oldMobile: { type: String, default: "" },
|
|
66
|
+
publicActivityLimit: { type: Number, default: 5 },
|
|
67
|
+
placeId: { type: String },
|
|
68
|
+
paytmOpenId: { type: String },
|
|
69
|
+
paidHostName: { type: String, default: "" },
|
|
70
|
+
paidHostCity: { type: String, default: "" },
|
|
71
|
+
activityHistory: [
|
|
72
|
+
{
|
|
73
|
+
_id: false,
|
|
74
|
+
activityId: { type: String, unique: true },
|
|
75
|
+
activityTS: Date
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
lastProcessed: Date,
|
|
79
|
+
calendarLink: { type: String, default: "" },
|
|
80
|
+
activityStack: Boolean, // config which informs whether user's activities are to be stacked
|
|
81
|
+
extraFields: [{
|
|
82
|
+
_id: false,
|
|
83
|
+
id: { type: String, required: true },
|
|
84
|
+
value: { type: String, required: true }
|
|
85
|
+
}],
|
|
86
|
+
lastContactSyncedAt : {
|
|
87
|
+
type: Date,
|
|
88
|
+
default: null
|
|
89
|
+
},
|
|
90
|
+
onboardSource: {
|
|
91
|
+
type: String,
|
|
92
|
+
enum: ['web', 'android', 'ios', 'others'],
|
|
93
|
+
default: 'others'
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
timestamps: {
|
|
98
|
+
createdAt: 'createdTS',
|
|
99
|
+
updatedAt: 'modTS'
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
userSchema.index({ 'onesignalId': 1 }, { 'background': true })
|
|
104
|
+
userSchema.index({ 'mobile': 1 })
|
|
105
|
+
userSchema.index({ 'email': 1 }, { collation: { locale: "en", strength: 2 } }) // case insensitive index
|
|
106
|
+
userSchema.index({ 'officialEmail': 1 }, { collation: { locale: "en", strength: 2 } }) // case insensitive index
|
|
107
|
+
|
|
108
|
+
userSchema.index({ 'oldPlayoId': 1 })
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
const User = mongoose.model('User', userSchema);
|
|
112
|
+
module.exports = User;
|
package/lib/db/mongo.js
ADDED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
USER_MODELS: require('./schemas/userSchemas/_userIndex.js'),
|
|
3
|
-
ACTIVITY_MODELS: require('./schemas/activitySchemas/_activityIndex.js'),
|
|
4
|
-
VENUE_MODELS: require('./schemas/venueSchemas/_venueIndex.js'),
|
|
5
|
-
GAMEBOOK_MODELS: require('./schemas/gamebookSchemas/_gamebookIndex.js'),
|
|
1
|
+
module.exports = {
|
|
2
|
+
USER_MODELS: require('./schemas/userSchemas/_userIndex.js'),
|
|
3
|
+
ACTIVITY_MODELS: require('./schemas/activitySchemas/_activityIndex.js'),
|
|
4
|
+
VENUE_MODELS: require('./schemas/venueSchemas/_venueIndex.js'),
|
|
5
|
+
GAMEBOOK_MODELS: require('./schemas/gamebookSchemas/_gamebookIndex.js'),
|
|
6
6
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
userActivities: require('./userActivity.js'),
|
|
3
|
-
activityInsurance: require('./activityInsurance.js'),
|
|
4
|
-
activityLocations: require('./activityLocation.js'),
|
|
5
|
-
activityViews: require('./activityView.js'),
|
|
6
|
-
cronJobLogs: require('./cronJobLog.js'),
|
|
7
|
-
activityQueryBlocks: require('./activityQueryBlock.js'),
|
|
8
|
-
activityInsurances: require('./activityInsurance.js'),
|
|
9
|
-
playoGameRequests: require('./playogame.request.js'),
|
|
10
|
-
schedularTasks: require('./scheduled.tasks'),
|
|
1
|
+
module.exports = {
|
|
2
|
+
userActivities: require('./userActivity.js'),
|
|
3
|
+
activityInsurance: require('./activityInsurance.js'),
|
|
4
|
+
activityLocations: require('./activityLocation.js'),
|
|
5
|
+
activityViews: require('./activityView.js'),
|
|
6
|
+
cronJobLogs: require('./cronJobLog.js'),
|
|
7
|
+
activityQueryBlocks: require('./activityQueryBlock.js'),
|
|
8
|
+
activityInsurances: require('./activityInsurance.js'),
|
|
9
|
+
playoGameRequests: require('./playogame.request.js'),
|
|
10
|
+
schedularTasks: require('./scheduled.tasks'),
|
|
11
11
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var mongoose = require('mongoose');
|
|
2
|
-
var Schema = mongoose.Schema;
|
|
3
|
-
|
|
4
|
-
var InsuranceSchema = new Schema({
|
|
5
|
-
isEnabled: { type: Boolean, default: false },
|
|
6
|
-
insuranceFee: { type: Number, default: 9 },
|
|
7
|
-
insuranceDefault: {
|
|
8
|
-
startDate: { type: Date, required: true },
|
|
9
|
-
endDate: { type: Date, required: true },
|
|
10
|
-
fee: { type: Number, default: 0 }
|
|
11
|
-
},
|
|
12
|
-
insuranceInfo: { type: String, required: true },
|
|
13
|
-
freeInsuranceInfo: { type: String, required: true },
|
|
14
|
-
countryCode: { type: String, default: '+91' }
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
module.exports = mongoose.model('activityInsurance', InsuranceSchema);
|
|
1
|
+
var mongoose = require('mongoose');
|
|
2
|
+
var Schema = mongoose.Schema;
|
|
3
|
+
|
|
4
|
+
var InsuranceSchema = new Schema({
|
|
5
|
+
isEnabled: { type: Boolean, default: false },
|
|
6
|
+
insuranceFee: { type: Number, default: 9 },
|
|
7
|
+
insuranceDefault: {
|
|
8
|
+
startDate: { type: Date, required: true },
|
|
9
|
+
endDate: { type: Date, required: true },
|
|
10
|
+
fee: { type: Number, default: 0 }
|
|
11
|
+
},
|
|
12
|
+
insuranceInfo: { type: String, required: true },
|
|
13
|
+
freeInsuranceInfo: { type: String, required: true },
|
|
14
|
+
countryCode: { type: String, default: '+91' }
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
module.exports = mongoose.model('activityInsurance', InsuranceSchema);
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
const mongoose = require('mongoose')
|
|
2
|
-
const Schema = mongoose.Schema
|
|
3
|
-
|
|
4
|
-
const groupSchema = new Schema({
|
|
5
|
-
_id: false,
|
|
6
|
-
groupId: String,
|
|
7
|
-
modTS: Date
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const activityLocationSchema = new Schema(
|
|
11
|
-
{
|
|
12
|
-
id: { required: true, type: String, unique: true },
|
|
13
|
-
geoLocation: {
|
|
14
|
-
type: { type: String },
|
|
15
|
-
coordinates: [Number],
|
|
16
|
-
},
|
|
17
|
-
date: Date,
|
|
18
|
-
timing: Number,
|
|
19
|
-
startTime: { type: Date, default: "" },
|
|
20
|
-
endTime: { type: Date, default: "" },
|
|
21
|
-
sportId: { required: true, type: String },
|
|
22
|
-
isOnline: { type: Boolean, default: false },
|
|
23
|
-
priority: { type: Number, default: 10 },
|
|
24
|
-
recommended: {type: Boolean, default: false},
|
|
25
|
-
sponsored: { type: Boolean, default: false },
|
|
26
|
-
geoHash: { type: String },
|
|
27
|
-
cityCode: { type: Number },
|
|
28
|
-
countryCode: { type: String, default: "" },
|
|
29
|
-
sponsoredRadius: { type: Number, default: null }, // if null, show across city radius or, show to people in spoecified sponsoredRadius
|
|
30
|
-
full: { type: Boolean, default: false },
|
|
31
|
-
activityType: { type: String, default: "regular" },
|
|
32
|
-
hostId: { type: String, required: true },
|
|
33
|
-
venueId: { default: "", type: String },
|
|
34
|
-
groupId: { type: String, default: "" },
|
|
35
|
-
booking: { type: Boolean, default: false },
|
|
36
|
-
type: { default: 0, type: Number }, // 0 - regular, 1 - pay and join
|
|
37
|
-
minSkill: { type: Number, default: 1, min: 1, max: 5 },// 1-5
|
|
38
|
-
maxSkill: { type: Number, default: 5, min: 1, max: 5 },
|
|
39
|
-
hostType: {
|
|
40
|
-
type: String,
|
|
41
|
-
enum: ['playo-game', 'regular'],
|
|
42
|
-
default: 'regular'
|
|
43
|
-
},
|
|
44
|
-
joinees: [{
|
|
45
|
-
_id: false,
|
|
46
|
-
userId: { type: String, required: true },
|
|
47
|
-
joineeMsg: { type: String, default: "" },
|
|
48
|
-
hostMsg: { type: String, default: "" },
|
|
49
|
-
timestamp: { type: Date, default: Date.now },
|
|
50
|
-
status: { type: Number, required: true, min: -1, max: 4 }, //-1 to 5 ;-1= Request/Revoke,0-Request Pending,1-Request/Accept,2-Request/Reject,3-Accept/Revoked,4-Invited/Pending,5-Invite/Revoke
|
|
51
|
-
ticketCount: { type: Number, default: 1 }, // no of tickets booked
|
|
52
|
-
sentBy: String,
|
|
53
|
-
rejectedBy: { type: String, default: "" }, // differentiate between host and cohost
|
|
54
|
-
muteNotifications: { type: Boolean, default: false },
|
|
55
|
-
amount: { type: Number, default: 0 },
|
|
56
|
-
refunded: { type: Boolean, default: 0 },
|
|
57
|
-
acceptTS: { type: Date, default: null }
|
|
58
|
-
}],
|
|
59
|
-
strictSkill: { type: Boolean, default: false },
|
|
60
|
-
sportsPlayingMode: {
|
|
61
|
-
_id: false,
|
|
62
|
-
name: { type: String, default: '' },
|
|
63
|
-
icon: { type: String, default: '' }
|
|
64
|
-
},
|
|
65
|
-
cohostId: { type: String, default: '' },
|
|
66
|
-
maxPlayers: { type: Number, default: -1 },
|
|
67
|
-
groups: [
|
|
68
|
-
groupSchema
|
|
69
|
-
],
|
|
70
|
-
location: { type: String, required: true },
|
|
71
|
-
price: { type: Number, default: 0 },
|
|
72
|
-
bookingId: {type:String,default:""},
|
|
73
|
-
bookedBy: {type:String,default:""},//mongoId
|
|
74
|
-
skillSet: { type: Boolean, default: false },
|
|
75
|
-
createdTS: { type: Date, default: Date.now },
|
|
76
|
-
modTS: { type: Date, default: Date.now },
|
|
77
|
-
venueName: { default: "", type: String },
|
|
78
|
-
createdBy: { type: Number, default: 0 },// when booking happened app will create activity for that sport with different createdBy value
|
|
79
|
-
bookingType: { type: Number, default: 0 }, // 0- playo booking, 1-offline
|
|
80
|
-
courtInfo: { type: String, default: "" },
|
|
81
|
-
groupName: { type: String, default: "" },
|
|
82
|
-
currencyTxt: { type: String, default: "" },
|
|
83
|
-
// activityStack: {type: Boolean},
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
module.exports = mongoose.model("activityLocation", activityLocationSchema)
|
|
88
|
-
/*
|
|
89
|
-
|
|
90
|
-
GeoHash length Grid Area width x height
|
|
91
|
-
|
|
92
|
-
1 ≤ 5,000km X 5,000 Km
|
|
93
|
-
2 ≤ 1,250km X 625km
|
|
94
|
-
3 ≤ 156km X 156km
|
|
95
|
-
4 ≤ 39.1km X 19.5km
|
|
96
|
-
5 ≤ 4.89km X 4.89km
|
|
97
|
-
6 ≤ 1.22km X 0.61km
|
|
98
|
-
7 ≤ 153m X 153m
|
|
99
|
-
8 ≤ 38.2m X 19.1m
|
|
100
|
-
9 ≤ 4.77m X 4.77m
|
|
101
|
-
10 ≤ 1.19m X 0.596m
|
|
102
|
-
11 ≤ 149mm X 149mm
|
|
103
|
-
12 ≤ 37.2mm X 18.6mm
|
|
104
|
-
|
|
1
|
+
const mongoose = require('mongoose')
|
|
2
|
+
const Schema = mongoose.Schema
|
|
3
|
+
|
|
4
|
+
const groupSchema = new Schema({
|
|
5
|
+
_id: false,
|
|
6
|
+
groupId: String,
|
|
7
|
+
modTS: Date
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const activityLocationSchema = new Schema(
|
|
11
|
+
{
|
|
12
|
+
id: { required: true, type: String, unique: true },
|
|
13
|
+
geoLocation: {
|
|
14
|
+
type: { type: String },
|
|
15
|
+
coordinates: [Number],
|
|
16
|
+
},
|
|
17
|
+
date: Date,
|
|
18
|
+
timing: Number,
|
|
19
|
+
startTime: { type: Date, default: "" },
|
|
20
|
+
endTime: { type: Date, default: "" },
|
|
21
|
+
sportId: { required: true, type: String },
|
|
22
|
+
isOnline: { type: Boolean, default: false },
|
|
23
|
+
priority: { type: Number, default: 10 },
|
|
24
|
+
recommended: {type: Boolean, default: false},
|
|
25
|
+
sponsored: { type: Boolean, default: false },
|
|
26
|
+
geoHash: { type: String },
|
|
27
|
+
cityCode: { type: Number },
|
|
28
|
+
countryCode: { type: String, default: "" },
|
|
29
|
+
sponsoredRadius: { type: Number, default: null }, // if null, show across city radius or, show to people in spoecified sponsoredRadius
|
|
30
|
+
full: { type: Boolean, default: false },
|
|
31
|
+
activityType: { type: String, default: "regular" },
|
|
32
|
+
hostId: { type: String, required: true },
|
|
33
|
+
venueId: { default: "", type: String },
|
|
34
|
+
groupId: { type: String, default: "" },
|
|
35
|
+
booking: { type: Boolean, default: false },
|
|
36
|
+
type: { default: 0, type: Number }, // 0 - regular, 1 - pay and join
|
|
37
|
+
minSkill: { type: Number, default: 1, min: 1, max: 5 },// 1-5
|
|
38
|
+
maxSkill: { type: Number, default: 5, min: 1, max: 5 },
|
|
39
|
+
hostType: {
|
|
40
|
+
type: String,
|
|
41
|
+
enum: ['playo-game', 'regular'],
|
|
42
|
+
default: 'regular'
|
|
43
|
+
},
|
|
44
|
+
joinees: [{
|
|
45
|
+
_id: false,
|
|
46
|
+
userId: { type: String, required: true },
|
|
47
|
+
joineeMsg: { type: String, default: "" },
|
|
48
|
+
hostMsg: { type: String, default: "" },
|
|
49
|
+
timestamp: { type: Date, default: Date.now },
|
|
50
|
+
status: { type: Number, required: true, min: -1, max: 4 }, //-1 to 5 ;-1= Request/Revoke,0-Request Pending,1-Request/Accept,2-Request/Reject,3-Accept/Revoked,4-Invited/Pending,5-Invite/Revoke
|
|
51
|
+
ticketCount: { type: Number, default: 1 }, // no of tickets booked
|
|
52
|
+
sentBy: String,
|
|
53
|
+
rejectedBy: { type: String, default: "" }, // differentiate between host and cohost
|
|
54
|
+
muteNotifications: { type: Boolean, default: false },
|
|
55
|
+
amount: { type: Number, default: 0 },
|
|
56
|
+
refunded: { type: Boolean, default: 0 },
|
|
57
|
+
acceptTS: { type: Date, default: null }
|
|
58
|
+
}],
|
|
59
|
+
strictSkill: { type: Boolean, default: false },
|
|
60
|
+
sportsPlayingMode: {
|
|
61
|
+
_id: false,
|
|
62
|
+
name: { type: String, default: '' },
|
|
63
|
+
icon: { type: String, default: '' }
|
|
64
|
+
},
|
|
65
|
+
cohostId: { type: String, default: '' },
|
|
66
|
+
maxPlayers: { type: Number, default: -1 },
|
|
67
|
+
groups: [
|
|
68
|
+
groupSchema
|
|
69
|
+
],
|
|
70
|
+
location: { type: String, required: true },
|
|
71
|
+
price: { type: Number, default: 0 },
|
|
72
|
+
bookingId: {type:String,default:""},
|
|
73
|
+
bookedBy: {type:String,default:""},//mongoId
|
|
74
|
+
skillSet: { type: Boolean, default: false },
|
|
75
|
+
createdTS: { type: Date, default: Date.now },
|
|
76
|
+
modTS: { type: Date, default: Date.now },
|
|
77
|
+
venueName: { default: "", type: String },
|
|
78
|
+
createdBy: { type: Number, default: 0 },// when booking happened app will create activity for that sport with different createdBy value
|
|
79
|
+
bookingType: { type: Number, default: 0 }, // 0- playo booking, 1-offline
|
|
80
|
+
courtInfo: { type: String, default: "" },
|
|
81
|
+
groupName: { type: String, default: "" },
|
|
82
|
+
currencyTxt: { type: String, default: "" },
|
|
83
|
+
// activityStack: {type: Boolean},
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
module.exports = mongoose.model("activityLocation", activityLocationSchema)
|
|
88
|
+
/*
|
|
89
|
+
|
|
90
|
+
GeoHash length Grid Area width x height
|
|
91
|
+
|
|
92
|
+
1 ≤ 5,000km X 5,000 Km
|
|
93
|
+
2 ≤ 1,250km X 625km
|
|
94
|
+
3 ≤ 156km X 156km
|
|
95
|
+
4 ≤ 39.1km X 19.5km
|
|
96
|
+
5 ≤ 4.89km X 4.89km
|
|
97
|
+
6 ≤ 1.22km X 0.61km
|
|
98
|
+
7 ≤ 153m X 153m
|
|
99
|
+
8 ≤ 38.2m X 19.1m
|
|
100
|
+
9 ≤ 4.77m X 4.77m
|
|
101
|
+
10 ≤ 1.19m X 0.596m
|
|
102
|
+
11 ≤ 149mm X 149mm
|
|
103
|
+
12 ≤ 37.2mm X 18.6mm
|
|
104
|
+
|
|
105
105
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const Mongoose = require("mongoose")
|
|
2
|
-
const Schema = Mongoose.Schema
|
|
3
|
-
|
|
4
|
-
const activityQueryBlockSchema = new Schema(
|
|
5
|
-
{
|
|
6
|
-
userId: { type: String, required: true },
|
|
7
|
-
expiry: { type: Date, required: true }
|
|
8
|
-
}
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
const Mongoose = require("mongoose")
|
|
2
|
+
const Schema = Mongoose.Schema
|
|
3
|
+
|
|
4
|
+
const activityQueryBlockSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
userId: { type: String, required: true },
|
|
7
|
+
expiry: { type: Date, required: true }
|
|
8
|
+
}
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
12
|
module.exports = Mongoose.model("activityQueryBlock", activityQueryBlockSchema)
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const Mongoose = require("mongoose")
|
|
2
|
-
const Schema = Mongoose.Schema
|
|
3
|
-
|
|
4
|
-
const activityViewSchema = new Schema(
|
|
5
|
-
{
|
|
6
|
-
userId: { type: String, required: true },
|
|
7
|
-
activityId: { type: String, required: true },
|
|
8
|
-
count: { type: Number, default: 0 },
|
|
9
|
-
createdTS: { type: Date, default: Date.now }
|
|
10
|
-
}
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
const Mongoose = require("mongoose")
|
|
2
|
+
const Schema = Mongoose.Schema
|
|
3
|
+
|
|
4
|
+
const activityViewSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
userId: { type: String, required: true },
|
|
7
|
+
activityId: { type: String, required: true },
|
|
8
|
+
count: { type: Number, default: 0 },
|
|
9
|
+
createdTS: { type: Date, default: Date.now }
|
|
10
|
+
}
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
14
|
module.exports = Mongoose.model("activityView", activityViewSchema)
|