playov2-js-utilities 0.3.63 → 0.3.65
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/lib/db_interface/mongo/index.js +4 -2
- package/lib/db_interface/mongo/schemas/activitySchemas/_activityIndex.js +2 -2
- package/lib/db_interface/mongo/schemas/gamebookSchemas/_gamebookIndex.js +3 -0
- package/lib/db_interface/mongo/schemas/gamebookSchemas/activityNotes.js +20 -0
- package/lib/db_interface/mongo/schemas/gamebookSchemas/expense.js +36 -0
- package/lib/db_interface/mongo/schemas/gamebookSchemas/expenseLogs.js +13 -0
- package/lib/db_interface/mongo/schemas/gamebookSchemas/message.requests.js +29 -0
- package/lib/db_interface/mongo/schemas/gamebookSchemas/nonPlayoExpenseUsers.js +14 -0
- package/lib/db_interface/mongo/schemas/gamebookSchemas/playpals.js +69 -0
- package/lib/db_interface/mongo/schemas/gamebookSchemas/postActivity.js +51 -0
- package/lib/db_interface/mongo/schemas/gamebookSchemas/tags.js +13 -0
- package/lib/db_interface/mongo/schemas/userSchemas/_userIndex.js +3 -3
- package/lib/db_interface/mongo/schemas/venueSchemas/_venueIndex.js +4 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/ameneties.js +9 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/cityArea.js +45 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/clubConstraints.js +17 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/corporateOffer.js +17 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/couponOffers.js +39 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/gamebagMember.js +12 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/offer.js +48 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/thirdParty.js +13 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/venue.js +134 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/venueEnquires.js +23 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/venueMembers.js +15 -0
- package/lib/db_interface/mongo/schemas/venueSchemas/venueRating.js +18 -0
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
USER_MODELS: require('./userSchemas/_userIndex.js'),
|
|
3
|
-
ACTIVITY_MODELS: require('./activitySchemas/_activityIndex.js')
|
|
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'),
|
|
4
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
2
|
+
userActivities: require('./userActivity.js'),
|
|
3
3
|
activityInsurance: require('./activityInsurance.js'),
|
|
4
|
-
|
|
4
|
+
activityLocations: require('./activityLocation.js'),
|
|
5
5
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const MONGOOSE = require("mongoose")
|
|
2
|
+
const Schema = MONGOOSE.Schema
|
|
3
|
+
|
|
4
|
+
const activityNotesSchema = new Schema({
|
|
5
|
+
activityId: String,
|
|
6
|
+
userId: String,
|
|
7
|
+
notes: [{
|
|
8
|
+
_id: false,
|
|
9
|
+
noteId: String,
|
|
10
|
+
note: String,
|
|
11
|
+
timestamp: Date,
|
|
12
|
+
isRemoved: Boolean
|
|
13
|
+
}],
|
|
14
|
+
createdTS:{type:Date,default:Date.now},
|
|
15
|
+
modTS:{type:Date,default:Date.now}
|
|
16
|
+
},{timestamps:{createdAt:"createdTS",updatedAt:"modTS"}})
|
|
17
|
+
|
|
18
|
+
activityNotesSchema.index({ 'activityId': 1 })
|
|
19
|
+
|
|
20
|
+
module.exports = MONGOOSE.model("activityNotes", activityNotesSchema)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const MONGOOSE = require("mongoose");
|
|
2
|
+
const Schema = MONGOOSE.Schema;
|
|
3
|
+
const expenseSchema = new Schema(
|
|
4
|
+
{
|
|
5
|
+
activityId: {type: String, require: true},
|
|
6
|
+
costHead: {type: String, require: true},
|
|
7
|
+
amount: {type: Number, require: true},
|
|
8
|
+
currency: {type: String, require: true},
|
|
9
|
+
payerId: {type: String, require: true},
|
|
10
|
+
payerName: {type: String, require: true},
|
|
11
|
+
authorId: {type: String, require: true},
|
|
12
|
+
authorName: {type: String, require: true},
|
|
13
|
+
split: [
|
|
14
|
+
{
|
|
15
|
+
_id: false,
|
|
16
|
+
userId: {type: String, require: true},
|
|
17
|
+
username: {type: String, require: true},
|
|
18
|
+
paidAmount: {type: Number, default: 0}
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
comments: [
|
|
22
|
+
{
|
|
23
|
+
_id: false,
|
|
24
|
+
userId: {type: String, require: true},
|
|
25
|
+
comment: {type: String, require: false},
|
|
26
|
+
timestamp: {type: Date, require: true}
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
isDeleted: {type: Boolean, default: false}
|
|
30
|
+
},
|
|
31
|
+
{timestamps: {createdAt: "createdTS", updatedAt: "modTS"}}
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
expenseSchema.index({activityId: 1, payerId: 1});
|
|
35
|
+
|
|
36
|
+
module.exports = MONGOOSE.model("expenses", expenseSchema);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const MONGOOSE = require("mongoose");
|
|
2
|
+
const Schema = MONGOOSE.Schema;
|
|
3
|
+
const expenseLogSchema = new Schema(
|
|
4
|
+
{
|
|
5
|
+
activityId: {type: String, require: true},
|
|
6
|
+
log: {type: String, require: true}
|
|
7
|
+
},
|
|
8
|
+
{timestamps: {createdAt: "createdTS", updatedAt: "modTS"}}
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
expenseLogSchema.index({activityId: 1});
|
|
12
|
+
|
|
13
|
+
module.exports = MONGOOSE.model("expenseLog", expenseLogSchema);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const Mongoose = require('mongoose');
|
|
2
|
+
const Schema = Mongoose.Schema;
|
|
3
|
+
const messagerequestSchema = new Schema(
|
|
4
|
+
{
|
|
5
|
+
receiverId: { // person who recieves the message request to be acted upon
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
senderId: { //
|
|
10
|
+
type: String,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
message: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
status: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
enum: ['pending', 'deleted', 'blocked', 'accepted'],
|
|
21
|
+
default: 'pending'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}, { timestamps: { createdAt: "createdTS", updatedAt: "modTS" } }
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
module.exports = Mongoose.model('messagerequests', messagerequestSchema);
|
|
28
|
+
|
|
29
|
+
// compound index on receiverId,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const MONGOOSE = require("mongoose");
|
|
2
|
+
const Schema = MONGOOSE.Schema;
|
|
3
|
+
const nonPlayoExpenseUsersSchema = new Schema(
|
|
4
|
+
{
|
|
5
|
+
userId: {type: String, require: true},
|
|
6
|
+
name: {type: String, require: true},
|
|
7
|
+
activityId: {type: String, require: true}
|
|
8
|
+
},
|
|
9
|
+
{timestamps: {createdAt: "createdTS", updatedAt: "modTS"}}
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
nonPlayoExpenseUsersSchema.index({userId: 1, activityId: 1});
|
|
13
|
+
|
|
14
|
+
module.exports = MONGOOSE.model("nonPlayoExpenseUsers", nonPlayoExpenseUsersSchema);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const MONGOOSE = require('mongoose');
|
|
2
|
+
const Schema = MONGOOSE.Schema;
|
|
3
|
+
const playpalSchema = new Schema(
|
|
4
|
+
{
|
|
5
|
+
userId: { type: String, required: true },
|
|
6
|
+
palId: { type: String, required: true },
|
|
7
|
+
ratings: [
|
|
8
|
+
{
|
|
9
|
+
_id: false,
|
|
10
|
+
sportId: { type: String, required: true },
|
|
11
|
+
previousRating: { type: Number, default: 0 },
|
|
12
|
+
rating: { type: Number, default: 0 },
|
|
13
|
+
timestamp: Date,
|
|
14
|
+
sportRemoved: { type: Boolean, default: false }
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
blocked: { type: Boolean, default: false }, // true - if user blocks playpal
|
|
18
|
+
removed: { type: Boolean, default: false },
|
|
19
|
+
isBlocked: { type: Boolean, default: false }, // true - if playpal blocks user
|
|
20
|
+
activities: [],
|
|
21
|
+
reputation: [{
|
|
22
|
+
_id: false,
|
|
23
|
+
reputationId: Number,
|
|
24
|
+
value: Number,
|
|
25
|
+
timestamp: Date
|
|
26
|
+
}],
|
|
27
|
+
reputationLog: [{
|
|
28
|
+
_id: false,
|
|
29
|
+
log: [{
|
|
30
|
+
_id: false,
|
|
31
|
+
reputationId: Number,
|
|
32
|
+
value: Number,
|
|
33
|
+
timestamp: Date
|
|
34
|
+
}]
|
|
35
|
+
}],
|
|
36
|
+
expenses: [{
|
|
37
|
+
_id: false,
|
|
38
|
+
activityId: { type: String, required: true },
|
|
39
|
+
amount: { type: Number, default: 0 },
|
|
40
|
+
paidAmount: { type: Number, default: 0 },
|
|
41
|
+
currency: { type: String, default: "" },
|
|
42
|
+
comments: []
|
|
43
|
+
}],
|
|
44
|
+
isNewPal: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
lastMutedAt: {
|
|
49
|
+
type: Date,
|
|
50
|
+
default: null
|
|
51
|
+
},
|
|
52
|
+
mutedTill: {
|
|
53
|
+
type: Date,
|
|
54
|
+
default: null
|
|
55
|
+
},
|
|
56
|
+
tags: {
|
|
57
|
+
type: Array,
|
|
58
|
+
default: []
|
|
59
|
+
},
|
|
60
|
+
createdTS: { type: Date, default: Date.now },
|
|
61
|
+
modTS: { type: Date, default: Date.now },
|
|
62
|
+
lastPlayed: { type: Date, default: Date.now },
|
|
63
|
+
}, { timestamps: { createdAt: "createdTS", updatedAt: "modTS" } }
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
playpalSchema.index({ 'userId': 1 });
|
|
67
|
+
playpalSchema.index({ 'palId': 1 });
|
|
68
|
+
|
|
69
|
+
module.exports = MONGOOSE.model('playpal', playpalSchema);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const MONGOOSE = require("mongoose");
|
|
2
|
+
const Schema = MONGOOSE.Schema;
|
|
3
|
+
const postActivitySchema = new Schema(
|
|
4
|
+
{
|
|
5
|
+
activityId: { type: String, required: true, primary: true },
|
|
6
|
+
date: { type: Date }, // activity date
|
|
7
|
+
timing: { type: Number }, // activity timing
|
|
8
|
+
startTime: { type: Date }, // activity startTime
|
|
9
|
+
endTime: { type: Date }, //activity endTime
|
|
10
|
+
userId: { type: String, required: true, primary: true },
|
|
11
|
+
location: { type: String, default: "" },
|
|
12
|
+
sportId: String,
|
|
13
|
+
hostId: { type: String, default: "" },
|
|
14
|
+
matchHappened: { type: Boolean, default: true },
|
|
15
|
+
matchRating: { type: Number, default: -1 }, // -1 nothing, 0-thumbsdown, 1-thumbsup
|
|
16
|
+
userPlayed: { type: Boolean, default: true }, // updated if user rates himself noshow and after calculating majority of noshow
|
|
17
|
+
expired: { type: Boolean, default: false },
|
|
18
|
+
pals: [
|
|
19
|
+
{
|
|
20
|
+
_id: false,
|
|
21
|
+
palId: { type: String, require: true },
|
|
22
|
+
noshow: { type: Boolean, default: false },
|
|
23
|
+
noshowSwitch: { type: Boolean, default: false }, // to show noshow switch or not
|
|
24
|
+
rating: { type: Number, default: 0 },
|
|
25
|
+
newPlaypal: { type: Boolean, default: false },
|
|
26
|
+
timestamp: { type: Date, default: Date.now },
|
|
27
|
+
reputation: [
|
|
28
|
+
{
|
|
29
|
+
_id: false,
|
|
30
|
+
reputationId: Number,
|
|
31
|
+
value: Number
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
userName: String,
|
|
35
|
+
firstRatedOn: { type: Date, default: null },
|
|
36
|
+
isRemoved: { type: Boolean, default: false }, // made true if this pal removes sport from his fav
|
|
37
|
+
userPresent : { type: Boolean, default: null } // if false user explicitly states the user wasn't present in game which adds user's rating to be considered for no-show pool
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
cancelled: { type: Boolean, default: false },
|
|
41
|
+
noshow: { type: Boolean, default: false },
|
|
42
|
+
createdTS: { type: Date, default: Date.now },
|
|
43
|
+
modTS: { type: Date, default: Date.now },
|
|
44
|
+
removed: { type: Boolean, default: false } // made true if this user removes this sport from his fav
|
|
45
|
+
},
|
|
46
|
+
{ timestamps: { createdAt: "createdTS", updatedAt: "modTS" } }
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
postActivitySchema.index({ userId: 1, activityId: 1 }, { unique: true });
|
|
50
|
+
|
|
51
|
+
module.exports = MONGOOSE.model("postActivity", postActivitySchema);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const MONGOOSE = require('mongoose');
|
|
2
|
+
const { Schema } = MONGOOSE;
|
|
3
|
+
|
|
4
|
+
const tagSchema = new Schema({
|
|
5
|
+
tagId: { type: String, required: true },
|
|
6
|
+
tagName: { type: String, required: true },
|
|
7
|
+
tagColor: { type: String, required: true },
|
|
8
|
+
ownerId: {type: String, required: true},
|
|
9
|
+
isSystemTag: { type: Boolean, default: false },
|
|
10
|
+
isDeleted: { type: Boolean, default: false },
|
|
11
|
+
}, { timestamps: { createdAt: 'createdTS', updatedAt: 'modTS' } });
|
|
12
|
+
|
|
13
|
+
module.exports = MONGOOSE.model('tag', tagSchema);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
users: require('./user.js'),
|
|
3
|
+
userFavorites: require("./userFavourites.js"),
|
|
4
4
|
sports: require("./sports.js"),
|
|
5
5
|
cities: require("./city.js"),
|
|
6
6
|
blockedUsers: require("./blockedUser.js"),
|
|
7
|
-
|
|
7
|
+
userReputations: require("./userReputation.js"),
|
|
8
8
|
}
|
|
@@ -0,0 +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);
|
|
@@ -0,0 +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);
|
|
@@ -0,0 +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)
|
|
@@ -0,0 +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);
|
|
@@ -0,0 +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
|
+
|
|
12
|
+
module.exports = mongoose.model('GamebagMember', GamebagMemberSchema);
|
|
@@ -0,0 +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);
|
|
@@ -0,0 +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
|
+
|
|
13
|
+
module.exports = Mongoose.model("thirdParty",thirdPartySchema)
|
|
@@ -0,0 +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);
|
|
@@ -0,0 +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
|
+
|
|
23
|
+
module.exports = mongoose.model('VenueEnquiry', VenueEnquirySchema);
|
|
@@ -0,0 +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
|
+
|
|
15
|
+
module.exports = mongoose.model('VenueMember', VenueMemberSchema);
|
|
@@ -0,0 +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);
|