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.
Files changed (82) hide show
  1. package/README.md +28 -28
  2. package/index.js +4 -4
  3. package/lib/constants.js +20 -20
  4. package/lib/cron.js +43 -43
  5. package/lib/db/models/user.js +112 -0
  6. package/lib/db/mongo.js +3 -0
  7. package/lib/db_interface/mongo/index.js +5 -5
  8. package/lib/db_interface/mongo/schemas/activitySchemas/_activityIndex.js +10 -10
  9. package/lib/db_interface/mongo/schemas/activitySchemas/activityInsurance.js +17 -17
  10. package/lib/db_interface/mongo/schemas/activitySchemas/activityLocation.js +104 -104
  11. package/lib/db_interface/mongo/schemas/activitySchemas/activityQueryBlock.js +11 -11
  12. package/lib/db_interface/mongo/schemas/activitySchemas/activityView.js +13 -13
  13. package/lib/db_interface/mongo/schemas/activitySchemas/cronJobLog.js +12 -12
  14. package/lib/db_interface/mongo/schemas/activitySchemas/playogame.request.js +37 -37
  15. package/lib/db_interface/mongo/schemas/activitySchemas/scheduled.tasks.js +52 -52
  16. package/lib/db_interface/mongo/schemas/activitySchemas/userActivity.js +133 -133
  17. package/lib/db_interface/mongo/schemas/gamebookSchemas/_gamebookIndex.js +2 -2
  18. package/lib/db_interface/mongo/schemas/gamebookSchemas/activityNotes.js +19 -19
  19. package/lib/db_interface/mongo/schemas/gamebookSchemas/expense.js +36 -36
  20. package/lib/db_interface/mongo/schemas/gamebookSchemas/expenseLogs.js +13 -13
  21. package/lib/db_interface/mongo/schemas/gamebookSchemas/message.requests.js +29 -29
  22. package/lib/db_interface/mongo/schemas/gamebookSchemas/nonPlayoExpenseUsers.js +14 -14
  23. package/lib/db_interface/mongo/schemas/gamebookSchemas/playpals.js +69 -69
  24. package/lib/db_interface/mongo/schemas/gamebookSchemas/postActivity.js +51 -51
  25. package/lib/db_interface/mongo/schemas/gamebookSchemas/tags.js +12 -12
  26. package/lib/db_interface/mongo/schemas/userSchemas/QuickActions.js +25 -25
  27. package/lib/db_interface/mongo/schemas/userSchemas/_userIndex.js +7 -7
  28. package/lib/db_interface/mongo/schemas/userSchemas/blockedUser.js +11 -11
  29. package/lib/db_interface/mongo/schemas/userSchemas/city.js +62 -62
  30. package/lib/db_interface/mongo/schemas/userSchemas/country.js +63 -63
  31. package/lib/db_interface/mongo/schemas/userSchemas/emailOtp.js +12 -12
  32. package/lib/db_interface/mongo/schemas/userSchemas/emailVerificationToken.js +11 -11
  33. package/lib/db_interface/mongo/schemas/userSchemas/gt.trial.games.js +24 -24
  34. package/lib/db_interface/mongo/schemas/userSchemas/invite.js +14 -14
  35. package/lib/db_interface/mongo/schemas/userSchemas/karmaConfig.js +11 -11
  36. package/lib/db_interface/mongo/schemas/userSchemas/karmaLog.js +28 -28
  37. package/lib/db_interface/mongo/schemas/userSchemas/passwordResetToken.js +11 -11
  38. package/lib/db_interface/mongo/schemas/userSchemas/playo.subscription.pack.js +67 -67
  39. package/lib/db_interface/mongo/schemas/userSchemas/rankings.js +16 -16
  40. package/lib/db_interface/mongo/schemas/userSchemas/sports.js +26 -26
  41. package/lib/db_interface/mongo/schemas/userSchemas/sportsCategory.js +11 -11
  42. package/lib/db_interface/mongo/schemas/userSchemas/tempUser.js +35 -35
  43. package/lib/db_interface/mongo/schemas/userSchemas/trendingSports.js +14 -14
  44. package/lib/db_interface/mongo/schemas/userSchemas/user.activity.health.kit.data.js +26 -26
  45. package/lib/db_interface/mongo/schemas/userSchemas/user.contacts.js +33 -33
  46. package/lib/db_interface/mongo/schemas/userSchemas/user.js +111 -111
  47. package/lib/db_interface/mongo/schemas/userSchemas/userAlerts.js +23 -23
  48. package/lib/db_interface/mongo/schemas/userSchemas/userCredentials.js +50 -50
  49. package/lib/db_interface/mongo/schemas/userSchemas/userFavourites.js +81 -81
  50. package/lib/db_interface/mongo/schemas/userSchemas/userOtp.js +9 -9
  51. package/lib/db_interface/mongo/schemas/userSchemas/userReputation.js +21 -21
  52. package/lib/db_interface/mongo/schemas/userSchemas/userSocial.js +17 -17
  53. package/lib/db_interface/mongo/schemas/userSchemas/year.in.playo.js +51 -51
  54. package/lib/db_interface/mongo/schemas/venueSchemas/_venueIndex.js +3 -3
  55. package/lib/db_interface/mongo/schemas/venueSchemas/ameneties.js +9 -9
  56. package/lib/db_interface/mongo/schemas/venueSchemas/cityArea.js +45 -45
  57. package/lib/db_interface/mongo/schemas/venueSchemas/clubConstraints.js +17 -17
  58. package/lib/db_interface/mongo/schemas/venueSchemas/corporateOffer.js +17 -17
  59. package/lib/db_interface/mongo/schemas/venueSchemas/couponOffers.js +39 -39
  60. package/lib/db_interface/mongo/schemas/venueSchemas/gamebagMember.js +11 -11
  61. package/lib/db_interface/mongo/schemas/venueSchemas/offer.js +48 -48
  62. package/lib/db_interface/mongo/schemas/venueSchemas/thirdParty.js +12 -12
  63. package/lib/db_interface/mongo/schemas/venueSchemas/venue.js +134 -134
  64. package/lib/db_interface/mongo/schemas/venueSchemas/venueEnquires.js +22 -22
  65. package/lib/db_interface/mongo/schemas/venueSchemas/venueMembers.js +14 -14
  66. package/lib/db_interface/mongo/schemas/venueSchemas/venueRating.js +18 -18
  67. package/lib/index.js +22 -23
  68. package/lib/logger.js +115 -115
  69. package/lib/message_publisher/index.js +144 -144
  70. package/lib/middleware.js +46 -46
  71. package/lib/notification-templates.js +254 -254
  72. package/lib/notification.config.js +476 -476
  73. package/lib/playo.utils/playo.error.handler.js +23 -23
  74. package/lib/playo.utils/playo.http.handler.js +162 -162
  75. package/lib/playo.utils/playo.res.generator.js +58 -58
  76. package/lib/profanityFilter/profanityFilter.js +15 -16
  77. package/lib/profanityFilter/profanityWords.js +2 -2
  78. package/lib/ratings/index.js +95 -95
  79. package/lib/request.js +135 -135
  80. package/lib/responseHandler/responseHandler.js +52 -52
  81. package/lib/util.js +151 -151
  82. package/package.json +36 -36
@@ -1,81 +1,81 @@
1
- const MONGOOSE = require('mongoose')
2
- const Schema = MONGOOSE.Schema
3
-
4
- const UserFavouriteSchema = new Schema({
5
- userId: { type: String, unique: true, required: true },
6
- isTempUser: { type: Boolean, default: false },
7
- sports: [{
8
- _id: false,
9
- sportId: { type: String, required: true },
10
- selfRating: { type: Number, default: 0, min: 0, max: 5 },
11
- rating: { type: Number, default: 0, min: 0, max: 5 },
12
- ratingCount: { type: Number, default: 0, min: 0 },
13
- matches: { type: Number, default: 0, min: 0 },
14
- active: { type: Boolean, default: true },
15
- oldCount: { type: Number, default: 0 }, // matched count is added when user reset sport stats
16
- timestamp: Date,
17
- lastReset: { type: Date },
18
- activityRank: { type: Number, default: 0 }
19
- }],
20
- activityShortlist: [], //list of actvityId
21
- venueBookmarks: [],//list of venueIds
22
- activityShortlistLog: [],
23
- areas: [{
24
- _id: false,
25
- geoLocation: {
26
- type: { type: String },
27
- coordinates: []
28
- },
29
- timestamp: { type: Date, default: Date.now },
30
- areaName: { type: String, required: true },
31
- type: { type: Number, default: 1 } // 1 - area, 2 - venue
32
- }],
33
- areasLog: [
34
- {
35
- _id: false,
36
- geoLocation: {
37
- type: { type: String },
38
- coordinates: []
39
- },
40
- timestamp: { type: Date, default: Date.now },
41
- areaName: { type: String, required: true },
42
- type: { type: Number, default: 1 } // 1- area, 2 - venue
43
- }
44
- ],
45
- blocked: [], //list of userIds whom user blocked
46
- isBlocked: [], //list of userids who blocked user
47
- gatewayInfo: [{
48
- _id: false,
49
- gateway: { type: String, required: true },
50
- customerId: { type: String, required: true }
51
- }],
52
- notificationPref: [{
53
- _id: false,
54
- category: { type: String, required: true },
55
- status: { type: Boolean, required: true }
56
- }],
57
- lastPlayed: { type: Date, default: null },
58
- lastReset: { type: Date, default: null },
59
- weeklyHealthkitGoal: [{
60
- _id: false,
61
- weeklyMinutesGoal: {
62
- type: Number,
63
- default: 0
64
- },
65
- lastSetOn: {
66
- type: Date,
67
- default: null
68
- }
69
- }],
70
- healthkitSettings: {
71
- permissions: [],
72
- provider: { type: String },
73
- permissionProvidedDate: { type: Date, default: null }
74
- }
75
- }, { timestamps: { createdAt: 'createdTS', updatedAt: "modTS" } })
76
-
77
- UserFavouriteSchema.index({ 'activityShortlist': 1 }, { 'background': true })
78
-
79
-
80
- module.exports = MONGOOSE.model('userFavourites', UserFavouriteSchema)
81
-
1
+ const MONGOOSE = require('mongoose')
2
+ const Schema = MONGOOSE.Schema
3
+
4
+ const UserFavouriteSchema = new Schema({
5
+ userId: { type: String, unique: true, required: true },
6
+ isTempUser: { type: Boolean, default: false },
7
+ sports: [{
8
+ _id: false,
9
+ sportId: { type: String, required: true },
10
+ selfRating: { type: Number, default: 0, min: 0, max: 5 },
11
+ rating: { type: Number, default: 0, min: 0, max: 5 },
12
+ ratingCount: { type: Number, default: 0, min: 0 },
13
+ matches: { type: Number, default: 0, min: 0 },
14
+ active: { type: Boolean, default: true },
15
+ oldCount: { type: Number, default: 0 }, // matched count is added when user reset sport stats
16
+ timestamp: Date,
17
+ lastReset: { type: Date },
18
+ activityRank: { type: Number, default: 0 }
19
+ }],
20
+ activityShortlist: [], //list of actvityId
21
+ venueBookmarks: [],//list of venueIds
22
+ activityShortlistLog: [],
23
+ areas: [{
24
+ _id: false,
25
+ geoLocation: {
26
+ type: { type: String },
27
+ coordinates: []
28
+ },
29
+ timestamp: { type: Date, default: Date.now },
30
+ areaName: { type: String, required: true },
31
+ type: { type: Number, default: 1 } // 1 - area, 2 - venue
32
+ }],
33
+ areasLog: [
34
+ {
35
+ _id: false,
36
+ geoLocation: {
37
+ type: { type: String },
38
+ coordinates: []
39
+ },
40
+ timestamp: { type: Date, default: Date.now },
41
+ areaName: { type: String, required: true },
42
+ type: { type: Number, default: 1 } // 1- area, 2 - venue
43
+ }
44
+ ],
45
+ blocked: [], //list of userIds whom user blocked
46
+ isBlocked: [], //list of userids who blocked user
47
+ gatewayInfo: [{
48
+ _id: false,
49
+ gateway: { type: String, required: true },
50
+ customerId: { type: String, required: true }
51
+ }],
52
+ notificationPref: [{
53
+ _id: false,
54
+ category: { type: String, required: true },
55
+ status: { type: Boolean, required: true }
56
+ }],
57
+ lastPlayed: { type: Date, default: null },
58
+ lastReset: { type: Date, default: null },
59
+ weeklyHealthkitGoal: [{
60
+ _id: false,
61
+ weeklyMinutesGoal: {
62
+ type: Number,
63
+ default: 0
64
+ },
65
+ lastSetOn: {
66
+ type: Date,
67
+ default: null
68
+ }
69
+ }],
70
+ healthkitSettings: {
71
+ permissions: [],
72
+ provider: { type: String },
73
+ permissionProvidedDate: { type: Date, default: null }
74
+ }
75
+ }, { timestamps: { createdAt: 'createdTS', updatedAt: "modTS" } })
76
+
77
+ UserFavouriteSchema.index({ 'activityShortlist': 1 }, { 'background': true })
78
+
79
+
80
+ module.exports = MONGOOSE.model('userFavourites', UserFavouriteSchema)
81
+
@@ -1,10 +1,10 @@
1
- var mongoose = require('mongoose');
2
- var Schema = mongoose.Schema;
3
-
4
- var OTPSchema = new Schema({
5
- mobile: { type: String, required: true, unique: true },
6
- ts: { type: String, default: new Date() },
7
- otp: { type: Number, required: true }
8
- });
9
-
1
+ var mongoose = require('mongoose');
2
+ var Schema = mongoose.Schema;
3
+
4
+ var OTPSchema = new Schema({
5
+ mobile: { type: String, required: true, unique: true },
6
+ ts: { type: String, default: new Date() },
7
+ otp: { type: Number, required: true }
8
+ });
9
+
10
10
  module.exports = mongoose.model('OTP', OTPSchema);
@@ -1,22 +1,22 @@
1
- const MONGOOSE = require("mongoose")
2
- const Schema = MONGOOSE.Schema
3
- const userReputationSchema = new Schema(
4
- {
5
- userId: { type: String, primary: true, unique: true },
6
- reputations: [{
7
- _id: false,
8
- reputationId: { type: Number, required: true },
9
- upvotes: { type: Number, default: 0, required: true, min: 0 },
10
- downvotes: { type: Number, default: 0, required: true, min: 0 }
11
- }],
12
- noshow: [{
13
- _id: false,
14
- activityId: { type: String, required: true },
15
- timestamp: { type: Date, required: true },
16
- status: { type: Boolean, required: true }
17
- }]
18
- }, { timestamps: { createdAt: 'createdTS', updatedAt: "modTS" } }
19
- )
20
-
21
-
1
+ const MONGOOSE = require("mongoose")
2
+ const Schema = MONGOOSE.Schema
3
+ const userReputationSchema = new Schema(
4
+ {
5
+ userId: { type: String, primary: true, unique: true },
6
+ reputations: [{
7
+ _id: false,
8
+ reputationId: { type: Number, required: true },
9
+ upvotes: { type: Number, default: 0, required: true, min: 0 },
10
+ downvotes: { type: Number, default: 0, required: true, min: 0 }
11
+ }],
12
+ noshow: [{
13
+ _id: false,
14
+ activityId: { type: String, required: true },
15
+ timestamp: { type: Date, required: true },
16
+ status: { type: Boolean, required: true }
17
+ }]
18
+ }, { timestamps: { createdAt: 'createdTS', updatedAt: "modTS" } }
19
+ )
20
+
21
+
22
22
  module.exports = MONGOOSE.model("userReputation", userReputationSchema)
@@ -1,18 +1,18 @@
1
- const MONGOOSE = require("mongoose")
2
- const Schema = MONGOOSE.Schema
3
- const accountSchema = new Schema({
4
- _id: false,
5
- type: Number, // 0-google , 1-fb
6
- link: String,
7
- id: String,
8
- isActive: { type: Boolean, default: true }
9
- })
10
- const userSocialSchema = new Schema({
11
- userId: { type: String, unique: true },
12
- accounts: [
13
- accountSchema
14
- ]
15
- }, { timestamps: { createdAt: 'createdTS', updatedAt: "modTS" } })
16
-
17
-
1
+ const MONGOOSE = require("mongoose")
2
+ const Schema = MONGOOSE.Schema
3
+ const accountSchema = new Schema({
4
+ _id: false,
5
+ type: Number, // 0-google , 1-fb
6
+ link: String,
7
+ id: String,
8
+ isActive: { type: Boolean, default: true }
9
+ })
10
+ const userSocialSchema = new Schema({
11
+ userId: { type: String, unique: true },
12
+ accounts: [
13
+ accountSchema
14
+ ]
15
+ }, { timestamps: { createdAt: 'createdTS', updatedAt: "modTS" } })
16
+
17
+
18
18
  module.exports = MONGOOSE.model("userSocial", userSocialSchema)
@@ -1,52 +1,52 @@
1
- const MONGOOSE = require("mongoose")
2
- const Schema = MONGOOSE.Schema
3
- const yearInPlayoSchema = new Schema({
4
- userId: { type: String, unique: true },
5
- totalNumberOfGamesPlayed: { type: Number, default: 0 },
6
- totalNumberOfHoursPlayed: { type: Number, default: 0 },
7
- totalCaloriesBurnt: { type: Number, default: 0 },
8
- karma: {
9
- totalEarned: { type: Number, default: 0 },
10
- bestMonth: String,
11
- moneySavedByKarma: { type: Number, default: 0 },
12
- },
13
- venues: {
14
- venuesTried: { type: Number, default: 0 },
15
- favoriteVenue: String,
16
- totalGamesAtFavouriteVenue: Number
17
- },
18
- sports: {
19
- numberOfSportsPlayed: { type: Number, default: 0 }, // different sports user played last year
20
- favoriteSports: String,
21
- favouriteSportPlayedCount: { type: Number, default: 0 },
22
- },
23
- playpals: {
24
- newPlayPals: { type: Number, default: 0 },
25
- favorite: String,
26
- totalGamesWithFavoritePlayPal: { type: Number, default: 0 },
27
- topPlaypals: [
28
- {
29
- userId: String,
30
- name: String,
31
- profilePicUrl: String
32
- }
33
- ]
34
- },
35
- referredUsers: [
36
- {
37
- userId: String,
38
- name: String,
39
- profilePicUrl: String,
40
- gamesCompleted: { type: Number, default: 0 },
41
- }
42
- ],
43
- leaderBoardRank: { type: Number, default: 0 },
44
- year: Number,
45
- hours: {},
46
- url: String,
47
- cityCode: Number
48
- }, { timestamps: { createdAt: 'createdTS', updatedAt: "modTS" } })
49
-
50
- yearInPlayoSchema.index({ 'userId': 1 })
51
-
1
+ const MONGOOSE = require("mongoose")
2
+ const Schema = MONGOOSE.Schema
3
+ const yearInPlayoSchema = new Schema({
4
+ userId: { type: String, unique: true },
5
+ totalNumberOfGamesPlayed: { type: Number, default: 0 },
6
+ totalNumberOfHoursPlayed: { type: Number, default: 0 },
7
+ totalCaloriesBurnt: { type: Number, default: 0 },
8
+ karma: {
9
+ totalEarned: { type: Number, default: 0 },
10
+ bestMonth: String,
11
+ moneySavedByKarma: { type: Number, default: 0 },
12
+ },
13
+ venues: {
14
+ venuesTried: { type: Number, default: 0 },
15
+ favoriteVenue: String,
16
+ totalGamesAtFavouriteVenue: Number
17
+ },
18
+ sports: {
19
+ numberOfSportsPlayed: { type: Number, default: 0 }, // different sports user played last year
20
+ favoriteSports: String,
21
+ favouriteSportPlayedCount: { type: Number, default: 0 },
22
+ },
23
+ playpals: {
24
+ newPlayPals: { type: Number, default: 0 },
25
+ favorite: String,
26
+ totalGamesWithFavoritePlayPal: { type: Number, default: 0 },
27
+ topPlaypals: [
28
+ {
29
+ userId: String,
30
+ name: String,
31
+ profilePicUrl: String
32
+ }
33
+ ]
34
+ },
35
+ referredUsers: [
36
+ {
37
+ userId: String,
38
+ name: String,
39
+ profilePicUrl: String,
40
+ gamesCompleted: { type: Number, default: 0 },
41
+ }
42
+ ],
43
+ leaderBoardRank: { type: Number, default: 0 },
44
+ year: Number,
45
+ hours: {},
46
+ url: String,
47
+ cityCode: Number
48
+ }, { timestamps: { createdAt: 'createdTS', updatedAt: "modTS" } })
49
+
50
+ yearInPlayoSchema.index({ 'userId': 1 })
51
+
52
52
  module.exports = MONGOOSE.model("yearinplayo", yearInPlayoSchema)
@@ -1,4 +1,4 @@
1
- module.exports = {
2
- venueMembers: require('./venueMembers'),
3
- venues: require('./venue'),
1
+ module.exports = {
2
+ venueMembers: require('./venueMembers'),
3
+ venues: require('./venue'),
4
4
  }
@@ -1,9 +1,9 @@
1
- const mongoose = require("mongoose")
2
- const Schema = mongoose.Schema
3
- const amenetiesSchema = new Schema({
4
- amenityId: Number,
5
- amenityText: String
6
- })
7
-
8
- module.exports = mongoose.model("Amenties", amenetiesSchema)
9
-
1
+ const mongoose = require("mongoose")
2
+ const Schema = mongoose.Schema
3
+ const amenetiesSchema = new Schema({
4
+ amenityId: Number,
5
+ amenityText: String
6
+ })
7
+
8
+ module.exports = mongoose.model("Amenties", amenetiesSchema)
9
+
@@ -1,45 +1,45 @@
1
- const MONGOOSE = require("mongoose");
2
- const Schema = MONGOOSE.Schema;
3
-
4
- const cityAreaSchema = new Schema({
5
- id: { type: String, required: true },
6
- venues: [{ // GT venues - represented by venueIds
7
- _id: false,
8
- venueId: {
9
- type: String,
10
- required: true
11
- },
12
- /*DEPRECATED!*/ gtTrialMaxCount: { // max GT trial game per person --- deprecated!! - using percentage on area basis now
13
- type: Number,
14
- default: 0,
15
- required: true
16
- },
17
- enabled: {
18
- type: Boolean,
19
- default: true
20
- }
21
- }],
22
- cityCode: { type: Number, required: true },
23
- name: { type: String, required: true },
24
- geoLocation: {
25
- type: { type: String },
26
- coordinates: []
27
- },
28
- areaIllustrationImage: { type: String, required: false },
29
- active: { type: Boolean, default: true },
30
- gtTrialSteps: [{
31
- _id: false,
32
- discountPercentageAvailable: {
33
- type: Number,
34
- default: 0,
35
- min: 0,
36
- max: 100
37
- },
38
- step: {
39
- type: Number,
40
- default: 1
41
- }
42
- }]
43
- });
44
-
45
- module.exports = MONGOOSE.model("cityArea", cityAreaSchema);
1
+ const MONGOOSE = require("mongoose");
2
+ const Schema = MONGOOSE.Schema;
3
+
4
+ const cityAreaSchema = new Schema({
5
+ id: { type: String, required: true },
6
+ venues: [{ // GT venues - represented by venueIds
7
+ _id: false,
8
+ venueId: {
9
+ type: String,
10
+ required: true
11
+ },
12
+ /*DEPRECATED!*/ gtTrialMaxCount: { // max GT trial game per person --- deprecated!! - using percentage on area basis now
13
+ type: Number,
14
+ default: 0,
15
+ required: true
16
+ },
17
+ enabled: {
18
+ type: Boolean,
19
+ default: true
20
+ }
21
+ }],
22
+ cityCode: { type: Number, required: true },
23
+ name: { type: String, required: true },
24
+ geoLocation: {
25
+ type: { type: String },
26
+ coordinates: []
27
+ },
28
+ areaIllustrationImage: { type: String, required: false },
29
+ active: { type: Boolean, default: true },
30
+ gtTrialSteps: [{
31
+ _id: false,
32
+ discountPercentageAvailable: {
33
+ type: Number,
34
+ default: 0,
35
+ min: 0,
36
+ max: 100
37
+ },
38
+ step: {
39
+ type: Number,
40
+ default: 1
41
+ }
42
+ }]
43
+ });
44
+
45
+ module.exports = MONGOOSE.model("cityArea", cityAreaSchema);
@@ -1,17 +1,17 @@
1
- const MONGOOSE = require("mongoose");
2
- const Schema = MONGOOSE.Schema;
3
-
4
- const clubConstraintsSchema = new Schema(
5
- {
6
- venueId: {type: String, require: true},
7
- config: {
8
- bookingCheckout: {
9
- isEmailMandatory: {type: Boolean},
10
- isUniqueIdEnabled: {type: Boolean},
11
- }
12
- }
13
- },
14
- {strict: false}
15
- );
16
-
17
- module.exports = MONGOOSE.model("clubConstraints", clubConstraintsSchema);
1
+ const MONGOOSE = require("mongoose");
2
+ const Schema = MONGOOSE.Schema;
3
+
4
+ const clubConstraintsSchema = new Schema(
5
+ {
6
+ venueId: {type: String, require: true},
7
+ config: {
8
+ bookingCheckout: {
9
+ isEmailMandatory: {type: Boolean},
10
+ isUniqueIdEnabled: {type: Boolean},
11
+ }
12
+ }
13
+ },
14
+ {strict: false}
15
+ );
16
+
17
+ module.exports = MONGOOSE.model("clubConstraints", clubConstraintsSchema);
@@ -1,17 +1,17 @@
1
- const mongoose = require("mongoose")
2
- const Schema = mongoose.Schema
3
-
4
- const corporateOfferSchema = new Schema(
5
- {
6
- id:{type:String,unique:true,required:true},
7
- name:{type:String,required:true},
8
- logoUrl:{type:String,required:true},
9
- users:[String],
10
- percentage:{type:Number,required:true},
11
- upto:{type:Number,required:true},
12
- terms:{type:String}
13
-
14
- }
15
- )
16
-
17
- module.exports=mongoose.model("corporateOffer",corporateOfferSchema)
1
+ const mongoose = require("mongoose")
2
+ const Schema = mongoose.Schema
3
+
4
+ const corporateOfferSchema = new Schema(
5
+ {
6
+ id:{type:String,unique:true,required:true},
7
+ name:{type:String,required:true},
8
+ logoUrl:{type:String,required:true},
9
+ users:[String],
10
+ percentage:{type:Number,required:true},
11
+ upto:{type:Number,required:true},
12
+ terms:{type:String}
13
+
14
+ }
15
+ )
16
+
17
+ module.exports=mongoose.model("corporateOffer",corporateOfferSchema)
@@ -1,39 +1,39 @@
1
- const mongoose = require('mongoose');
2
- const { Schema, model } = mongoose;
3
-
4
- const couponOffersSchema = new Schema({
5
-
6
- id: { type: String, required: true, unique: true },
7
- offerName: { type: String, required: true }, // title of the offer kind of like short description
8
- description: { type: String, required: true }, // description of the offer
9
-
10
- couponCode: { type: String, required: true },
11
-
12
- couponAmount: { type: Number, default: null },
13
- couponLimit: { type: Number, default: null },
14
- couponPercent: { type: Number, default: null },
15
-
16
- detailDescription: { type: String, default: "" },
17
-
18
- venueIds: [{ type: String }],
19
- allVenues: { type: Boolean, default: false }, // offers valid for all venues
20
-
21
- sportIds: [{ type: String }],
22
- universal: { type: Boolean, default: false },
23
- countryCodes: { type: String },
24
-
25
- allCities: { type: Boolean, default: false },
26
- cityCodes: [{ type: String }],
27
-
28
- active: { type: Boolean, default: true },
29
- startDate: { type: Date, default: Date.now },
30
- expiryDate: { type: Date, default: "" },
31
-
32
-
33
- }, { timestamps: true });
34
-
35
- couponOffersSchema.index({ id: 1 });
36
- couponOffersSchema.index({ venueIds: 1 });
37
- couponOffersSchema.index({ cityCodes: 1, sportIds: 1, expiryDate: 1, startDate: 1 });
38
-
39
- module.exports = model('couponOffers', couponOffersSchema);
1
+ const mongoose = require('mongoose');
2
+ const { Schema, model } = mongoose;
3
+
4
+ const couponOffersSchema = new Schema({
5
+
6
+ id: { type: String, required: true, unique: true },
7
+ offerName: { type: String, required: true }, // title of the offer kind of like short description
8
+ description: { type: String, required: true }, // description of the offer
9
+
10
+ couponCode: { type: String, required: true },
11
+
12
+ couponAmount: { type: Number, default: null },
13
+ couponLimit: { type: Number, default: null },
14
+ couponPercent: { type: Number, default: null },
15
+
16
+ detailDescription: { type: String, default: "" },
17
+
18
+ venueIds: [{ type: String }],
19
+ allVenues: { type: Boolean, default: false }, // offers valid for all venues
20
+
21
+ sportIds: [{ type: String }],
22
+ universal: { type: Boolean, default: false },
23
+ countryCodes: { type: String },
24
+
25
+ allCities: { type: Boolean, default: false },
26
+ cityCodes: [{ type: String }],
27
+
28
+ active: { type: Boolean, default: true },
29
+ startDate: { type: Date, default: Date.now },
30
+ expiryDate: { type: Date, default: "" },
31
+
32
+
33
+ }, { timestamps: true });
34
+
35
+ couponOffersSchema.index({ id: 1 });
36
+ couponOffersSchema.index({ venueIds: 1 });
37
+ couponOffersSchema.index({ cityCodes: 1, sportIds: 1, expiryDate: 1, startDate: 1 });
38
+
39
+ module.exports = model('couponOffers', couponOffersSchema);
@@ -1,12 +1,12 @@
1
- const mongoose = require('mongoose');
2
- const Schema = mongoose.Schema;
3
-
4
- const GamebagMemberSchema = new Schema({
5
- venueId: { type: String, required: true, unique: true },
6
- users: [{
7
- _id: false,
8
- mobile: String,
9
- }]
10
- });
11
-
1
+ const mongoose = require('mongoose');
2
+ const Schema = mongoose.Schema;
3
+
4
+ const GamebagMemberSchema = new Schema({
5
+ venueId: { type: String, required: true, unique: true },
6
+ users: [{
7
+ _id: false,
8
+ mobile: String,
9
+ }]
10
+ });
11
+
12
12
  module.exports = mongoose.model('GamebagMember', GamebagMemberSchema);