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,64 +1,64 @@
1
- const MONGOOSE = require("mongoose")
2
- const Schema = MONGOOSE.Schema
3
-
4
-
5
-
6
- const countrySchema = new Schema(
7
- {
8
-
9
- karmaDebit: {
10
- isKarmaPercent: Boolean,
11
- karmaPercent: Number,
12
- karmaRatio: Number,
13
- absKarma: Number,
14
- },
15
- karmaCredit: {},
16
- timeZone: { type: String, default: "" },
17
- timeZoneName: String,
18
- countryCode: { type: String, required: true },
19
- countryId: { type: String, default: "" },
20
- countryAlpha3Code: { type : String, default: ""},
21
- currencyTxt: { type: String },
22
- curCode: { type: String, default: "" },
23
- name: { type: String, required: true },
24
- language: { type: String, default: "" },
25
- helpType: { type: Number, default: 0 },
26
- radius: { type: Number, default: 3 },
27
- areaRadius: Number,
28
- helpLine: String,
29
- geoLocation: {
30
- type: { type: String }, // type: multipolygon
31
- coordinates: []
32
- },
33
- countryBound: {
34
- },
35
- rawOffset: { type: Number, default: 0 },
36
- dstOffset: { type: Number, default: 0 },
37
- faqUrl: { type: String, default: "https://playo.co/support-v2/" },
38
- bulkBooking : { type: Boolean, default: false },
39
- notificationPref : [
40
- {
41
- category: String,
42
- status: Boolean
43
- }
44
- ],
45
- userFields : [{
46
- _id : false,
47
- id: {type: String, required: true },
48
- name: { type: String, required: true },
49
- type: { type: String, required: true },
50
- format: { type: String, required: true },
51
- mandatoryHosting: { type: Boolean, required: true },
52
- mandatoryPayment: { type: Boolean, required: true },
53
- mandatoryOffline: { type: Boolean, required: true },
54
- priority: { type: Number, required: true },
55
- venueSpecific: {type: Boolean, default: false },
56
- unique: { type: Boolean, default: false },
57
- render: { type: Boolean, default: true }
58
- }]
59
- }
60
- )
61
-
62
- countrySchema.index({ 'geoLocation': "2dsphere" })
63
-
1
+ const MONGOOSE = require("mongoose")
2
+ const Schema = MONGOOSE.Schema
3
+
4
+
5
+
6
+ const countrySchema = new Schema(
7
+ {
8
+
9
+ karmaDebit: {
10
+ isKarmaPercent: Boolean,
11
+ karmaPercent: Number,
12
+ karmaRatio: Number,
13
+ absKarma: Number,
14
+ },
15
+ karmaCredit: {},
16
+ timeZone: { type: String, default: "" },
17
+ timeZoneName: String,
18
+ countryCode: { type: String, required: true },
19
+ countryId: { type: String, default: "" },
20
+ countryAlpha3Code: { type : String, default: ""},
21
+ currencyTxt: { type: String },
22
+ curCode: { type: String, default: "" },
23
+ name: { type: String, required: true },
24
+ language: { type: String, default: "" },
25
+ helpType: { type: Number, default: 0 },
26
+ radius: { type: Number, default: 3 },
27
+ areaRadius: Number,
28
+ helpLine: String,
29
+ geoLocation: {
30
+ type: { type: String }, // type: multipolygon
31
+ coordinates: []
32
+ },
33
+ countryBound: {
34
+ },
35
+ rawOffset: { type: Number, default: 0 },
36
+ dstOffset: { type: Number, default: 0 },
37
+ faqUrl: { type: String, default: "https://playo.co/support-v2/" },
38
+ bulkBooking : { type: Boolean, default: false },
39
+ notificationPref : [
40
+ {
41
+ category: String,
42
+ status: Boolean
43
+ }
44
+ ],
45
+ userFields : [{
46
+ _id : false,
47
+ id: {type: String, required: true },
48
+ name: { type: String, required: true },
49
+ type: { type: String, required: true },
50
+ format: { type: String, required: true },
51
+ mandatoryHosting: { type: Boolean, required: true },
52
+ mandatoryPayment: { type: Boolean, required: true },
53
+ mandatoryOffline: { type: Boolean, required: true },
54
+ priority: { type: Number, required: true },
55
+ venueSpecific: {type: Boolean, default: false },
56
+ unique: { type: Boolean, default: false },
57
+ render: { type: Boolean, default: true }
58
+ }]
59
+ }
60
+ )
61
+
62
+ countrySchema.index({ 'geoLocation': "2dsphere" })
63
+
64
64
  module.exports = MONGOOSE.model("country", countrySchema)
@@ -1,13 +1,13 @@
1
- var mongoose = require('mongoose');
2
- const Moment = require("moment")
3
- var Schema = mongoose.Schema;
4
-
5
- var EmailOtoSchema = new Schema({
6
- email: { type: String, required: true, unique: true },
7
- ts: { type: String, default: Moment().add(4,"hours") },
8
- otp: { type: Number, required: true }
9
- },{timestamps:{createdAt:"createdTS",updatedAt:"modTS"}});
10
-
11
-
12
-
1
+ var mongoose = require('mongoose');
2
+ const Moment = require("moment")
3
+ var Schema = mongoose.Schema;
4
+
5
+ var EmailOtoSchema = new Schema({
6
+ email: { type: String, required: true, unique: true },
7
+ ts: { type: String, default: Moment().add(4,"hours") },
8
+ otp: { type: Number, required: true }
9
+ },{timestamps:{createdAt:"createdTS",updatedAt:"modTS"}});
10
+
11
+
12
+
13
13
  module.exports = mongoose.model('emailotp', EmailOtoSchema);
@@ -1,12 +1,12 @@
1
- const MONGOOSE = require("mongoose")
2
- const Schema = MONGOOSE.Schema
3
-
4
- const emailVerificationToken = new Schema(
5
- {
6
- userId: { type: String, required: true, unique: true },
7
- token: String,
8
- expiry: Date
9
- }
10
- , { timestamps: { createdAt: "createdTS", updatedAt: "modTS" } })
11
-
1
+ const MONGOOSE = require("mongoose")
2
+ const Schema = MONGOOSE.Schema
3
+
4
+ const emailVerificationToken = new Schema(
5
+ {
6
+ userId: { type: String, required: true, unique: true },
7
+ token: String,
8
+ expiry: Date
9
+ }
10
+ , { timestamps: { createdAt: "createdTS", updatedAt: "modTS" } })
11
+
12
12
  module.exports = MONGOOSE.model("emailverificationtoken", emailVerificationToken)
@@ -1,24 +1,24 @@
1
- const mongoose = require("mongoose");
2
- const Schema = mongoose.Schema;
3
- const gtTrialGamesSchema = new Schema(
4
- {
5
- userId: { type: String, required: true },
6
- activityId: { type: String, required: true },
7
- status: {
8
- type: String,
9
- required: true,
10
- default: "pending",
11
- enum: ["pending", "completed", "cancelled"],
12
- },
13
- venueId: { type: String, required: true },
14
- discountPercentageAvailed: {
15
- type: Number,
16
- min: 0,
17
- max: 100
18
- }
19
- },
20
- { timestamps: { createdAt: "createdTS", updatedAt: "modTS" } }
21
- );
22
- const gtTrialGames = mongoose.model("gtTrialGames", gtTrialGamesSchema);
23
-
24
- module.exports = gtTrialGames;
1
+ const mongoose = require("mongoose");
2
+ const Schema = mongoose.Schema;
3
+ const gtTrialGamesSchema = new Schema(
4
+ {
5
+ userId: { type: String, required: true },
6
+ activityId: { type: String, required: true },
7
+ status: {
8
+ type: String,
9
+ required: true,
10
+ default: "pending",
11
+ enum: ["pending", "completed", "cancelled"],
12
+ },
13
+ venueId: { type: String, required: true },
14
+ discountPercentageAvailed: {
15
+ type: Number,
16
+ min: 0,
17
+ max: 100
18
+ }
19
+ },
20
+ { timestamps: { createdAt: "createdTS", updatedAt: "modTS" } }
21
+ );
22
+ const gtTrialGames = mongoose.model("gtTrialGames", gtTrialGamesSchema);
23
+
24
+ module.exports = gtTrialGames;
@@ -1,14 +1,14 @@
1
- var mongoose = require('mongoose');
2
- var Schema = mongoose.Schema;
3
-
4
- var InviteSchema = new Schema({
5
- userId: { type: String, required: true },
6
- invites: [{
7
- _id: false,
8
- invitee: { type: String, required: true },
9
- modTS: { type: Date, default: Date.now },
10
- tag: String
11
- }]
12
- });
13
-
14
- module.exports = mongoose.model('Invite', InviteSchema);
1
+ var mongoose = require('mongoose');
2
+ var Schema = mongoose.Schema;
3
+
4
+ var InviteSchema = new Schema({
5
+ userId: { type: String, required: true },
6
+ invites: [{
7
+ _id: false,
8
+ invitee: { type: String, required: true },
9
+ modTS: { type: Date, default: Date.now },
10
+ tag: String
11
+ }]
12
+ });
13
+
14
+ module.exports = mongoose.model('Invite', InviteSchema);
@@ -1,12 +1,12 @@
1
- const MONGOOSE = require("mongoose")
2
- const Schema = MONGOOSE.Schema
3
-
4
- const karmaConfigSchema = new Schema(
5
- {
6
- id: { type: String, default: "" },
7
- karma: { type: Number, default: 0 },
8
- remarks: { type: String, default: "" }
9
- }
10
- )
11
-
1
+ const MONGOOSE = require("mongoose")
2
+ const Schema = MONGOOSE.Schema
3
+
4
+ const karmaConfigSchema = new Schema(
5
+ {
6
+ id: { type: String, default: "" },
7
+ karma: { type: Number, default: 0 },
8
+ remarks: { type: String, default: "" }
9
+ }
10
+ )
11
+
12
12
  module.exports = MONGOOSE.model("karmaconfig", karmaConfigSchema)
@@ -1,29 +1,29 @@
1
- const MONGOOSE = require("mongoose")
2
- const Schema = MONGOOSE.Schema
3
- const karmaLogSchema = new Schema({
4
- userId: String,
5
- karma: Number,
6
- createdTS: { type: Date, default: Date.now },
7
- type: String,
8
- remarks: String,
9
- id: String
10
- }, { timestamps: { createdAt: 'createdTS', updatedAt: "modTS" } })
11
-
12
- karmaLogSchema.index({ 'userId': 1, 'id': 1 })
13
-
14
- module.exports = MONGOOSE.model("karmalog", karmaLogSchema)
15
-
16
- /**
17
- type={
18
- activity: on finishing a match successfully
19
- firstActivity: on hosting first match successfully
20
- venue: on rating avenue
21
- referral: on successfull referral
22
- profile: on succesfully completing the profile
23
- onboard: on on boarding into app,
24
- host: karma for successfully hosting activity ,
25
- reset: on resetting account,
26
- custom: any custom karma
27
- }
28
-
1
+ const MONGOOSE = require("mongoose")
2
+ const Schema = MONGOOSE.Schema
3
+ const karmaLogSchema = new Schema({
4
+ userId: String,
5
+ karma: Number,
6
+ createdTS: { type: Date, default: Date.now },
7
+ type: String,
8
+ remarks: String,
9
+ id: String
10
+ }, { timestamps: { createdAt: 'createdTS', updatedAt: "modTS" } })
11
+
12
+ karmaLogSchema.index({ 'userId': 1, 'id': 1 })
13
+
14
+ module.exports = MONGOOSE.model("karmalog", karmaLogSchema)
15
+
16
+ /**
17
+ type={
18
+ activity: on finishing a match successfully
19
+ firstActivity: on hosting first match successfully
20
+ venue: on rating avenue
21
+ referral: on successfull referral
22
+ profile: on succesfully completing the profile
23
+ onboard: on on boarding into app,
24
+ host: karma for successfully hosting activity ,
25
+ reset: on resetting account,
26
+ custom: any custom karma
27
+ }
28
+
29
29
  */
@@ -1,12 +1,12 @@
1
- const MONGOOSE = require("mongoose")
2
- const Schema = MONGOOSE.Schema
3
-
4
- const passwordResetToken = new Schema(
5
- {
6
- userId: { type: String, required: true, unique : true },
7
- token: String,
8
- expiry: Date
9
- }
10
- )
11
-
1
+ const MONGOOSE = require("mongoose")
2
+ const Schema = MONGOOSE.Schema
3
+
4
+ const passwordResetToken = new Schema(
5
+ {
6
+ userId: { type: String, required: true, unique : true },
7
+ token: String,
8
+ expiry: Date
9
+ }
10
+ )
11
+
12
12
  module.exports = MONGOOSE.model("passwordresettoken", passwordResetToken)
@@ -1,67 +1,67 @@
1
- const mongoose = require("mongoose");
2
- const MongooseUtils = require("../mongoose.utils");
3
-
4
- const PlayoSubscriptionSchema = new mongoose.Schema(
5
- {
6
- id: {
7
- type: String,
8
- required: true,
9
- unique: true,
10
- },
11
- name: {
12
- type: String,
13
- required: true,
14
- },
15
- cityCode: {
16
- type: String,
17
- required: true,
18
- },
19
- sportId: {
20
- type: String,
21
- required: true,
22
- },
23
- price: {
24
- type: Number,
25
- required: true,
26
- },
27
- strikeThroughPrice: {
28
- type: Number,
29
- required: true
30
- },
31
- currencyText: {
32
- type: String,
33
- default: "INR",
34
- },
35
- slotsCount: {
36
- type: Number,
37
- required: true
38
- },
39
- active: {
40
- type: Boolean,
41
- default: true,
42
- },
43
- colorCode: {
44
- type: String,
45
- required: true
46
- },
47
- icon: {
48
- type: String,
49
- },
50
- daysValid: {
51
- type: Number,
52
- },
53
- valueSavedPerGame: {
54
- type: Number,
55
- },
56
- maxActiveSubscriptions: {
57
- type: Number
58
- },
59
- countryCode: {
60
- type: String,
61
- default: '+91'
62
- }
63
- },
64
- MongooseUtils.defaultSchemaOptions
65
- );
66
-
67
- module.exports = mongoose.model("playosubscriptions", PlayoSubscriptionSchema);
1
+ const mongoose = require("mongoose");
2
+ const MongooseUtils = require("../mongoose.utils");
3
+
4
+ const PlayoSubscriptionSchema = new mongoose.Schema(
5
+ {
6
+ id: {
7
+ type: String,
8
+ required: true,
9
+ unique: true,
10
+ },
11
+ name: {
12
+ type: String,
13
+ required: true,
14
+ },
15
+ cityCode: {
16
+ type: String,
17
+ required: true,
18
+ },
19
+ sportId: {
20
+ type: String,
21
+ required: true,
22
+ },
23
+ price: {
24
+ type: Number,
25
+ required: true,
26
+ },
27
+ strikeThroughPrice: {
28
+ type: Number,
29
+ required: true
30
+ },
31
+ currencyText: {
32
+ type: String,
33
+ default: "INR",
34
+ },
35
+ slotsCount: {
36
+ type: Number,
37
+ required: true
38
+ },
39
+ active: {
40
+ type: Boolean,
41
+ default: true,
42
+ },
43
+ colorCode: {
44
+ type: String,
45
+ required: true
46
+ },
47
+ icon: {
48
+ type: String,
49
+ },
50
+ daysValid: {
51
+ type: Number,
52
+ },
53
+ valueSavedPerGame: {
54
+ type: Number,
55
+ },
56
+ maxActiveSubscriptions: {
57
+ type: Number
58
+ },
59
+ countryCode: {
60
+ type: String,
61
+ default: '+91'
62
+ }
63
+ },
64
+ MongooseUtils.defaultSchemaOptions
65
+ );
66
+
67
+ module.exports = mongoose.model("playosubscriptions", PlayoSubscriptionSchema);
@@ -1,17 +1,17 @@
1
- const Mongoose = require("mongoose")
2
- const Schema = Mongoose.Schema
3
-
4
- const rankingsSchema = new Schema(
5
- {
6
- userId: { required: true, type: String },
7
- activityRank: { type: Number, default: 0 },
8
- matches: Number,
9
- sports: [{
10
- sportId: String,
11
- rank: Number,
12
- matches: Number
13
- }]
14
- }
15
- )
16
-
1
+ const Mongoose = require("mongoose")
2
+ const Schema = Mongoose.Schema
3
+
4
+ const rankingsSchema = new Schema(
5
+ {
6
+ userId: { required: true, type: String },
7
+ activityRank: { type: Number, default: 0 },
8
+ matches: Number,
9
+ sports: [{
10
+ sportId: String,
11
+ rank: Number,
12
+ matches: Number
13
+ }]
14
+ }
15
+ )
16
+
17
17
  module.exports = Mongoose.model("rankings", rankingsSchema)
@@ -1,26 +1,26 @@
1
- var mongoose = require('mongoose');
2
- var Schema = mongoose.Schema;
3
-
4
- var SportsSchema = new Schema({
5
- name: { type: String, required: true },
6
- sportId: { type: String, required: true, unique: true },
7
- isRateable: { type: Number, default: 1 },
8
- skillSet: [{
9
- skill: String
10
- }],
11
- grayIcon: String,
12
- colorIcon: String,
13
- v2GrayIcon: String,
14
- v2SportIllustration: String,
15
- sportsBro: [],
16
- active: { type: Boolean, default: true },
17
- content: { type: Boolean, default: false },
18
- sportsPlayingMode: [{
19
- name: { type: String },
20
- icon: { type: String }
21
- }],
22
- createdTS: { type: Date, default: Date.now },
23
- modTS: { type: Date, default: Date.now }
24
- });
25
-
26
- module.exports = mongoose.model('Sports', SportsSchema);
1
+ var mongoose = require('mongoose');
2
+ var Schema = mongoose.Schema;
3
+
4
+ var SportsSchema = new Schema({
5
+ name: { type: String, required: true },
6
+ sportId: { type: String, required: true, unique: true },
7
+ isRateable: { type: Number, default: 1 },
8
+ skillSet: [{
9
+ skill: String
10
+ }],
11
+ grayIcon: String,
12
+ colorIcon: String,
13
+ v2GrayIcon: String,
14
+ v2SportIllustration: String,
15
+ sportsBro: [],
16
+ active: { type: Boolean, default: true },
17
+ content: { type: Boolean, default: false },
18
+ sportsPlayingMode: [{
19
+ name: { type: String },
20
+ icon: { type: String }
21
+ }],
22
+ createdTS: { type: Date, default: Date.now },
23
+ modTS: { type: Date, default: Date.now }
24
+ });
25
+
26
+ module.exports = mongoose.model('Sports', SportsSchema);
@@ -1,12 +1,12 @@
1
- var mongoose = require('mongoose');
2
- var Schema = mongoose.Schema;
3
-
4
- var SportsCategorySchema = new Schema({
5
- id: String,
6
- name: String,
7
- priority: Number,
8
- sports: String,
9
- cityCode: Number,
10
- });
11
-
1
+ var mongoose = require('mongoose');
2
+ var Schema = mongoose.Schema;
3
+
4
+ var SportsCategorySchema = new Schema({
5
+ id: String,
6
+ name: String,
7
+ priority: Number,
8
+ sports: String,
9
+ cityCode: Number,
10
+ });
11
+
12
12
  module.exports = mongoose.model('SportsCategory', SportsCategorySchema);