playov2-js-utilities 0.3.70 → 0.3.74
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 +136 -134
- package/lib/db_interface/mongo/schemas/venueSchemas/venueEnquires.js +22 -22
- package/lib/db_interface/mongo/schemas/venueSchemas/venueMembers.js +14 -14
- package/lib/db_interface/mongo/schemas/venueSchemas/venueRating.js +18 -18
- package/lib/index.js +22 -23
- package/lib/logger.js +115 -115
- package/lib/message_publisher/index.js +144 -144
- package/lib/middleware.js +46 -46
- package/lib/notification-templates.js +254 -254
- package/lib/notification.config.js +476 -476
- package/lib/playo.utils/playo.error.handler.js +23 -23
- package/lib/playo.utils/playo.http.handler.js +162 -162
- package/lib/playo.utils/playo.res.generator.js +58 -58
- package/lib/profanityFilter/profanityFilter.js +15 -16
- package/lib/profanityFilter/profanityWords.js +2 -2
- package/lib/ratings/index.js +95 -95
- package/lib/request.js +135 -135
- package/lib/responseHandler/responseHandler.js +52 -52
- package/lib/util.js +151 -151
- package/package.json +36 -36
|
@@ -1,255 +1,255 @@
|
|
|
1
|
-
const { notificationIds } = require('./notification.config');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Template for sending notification whenever someone posts a questions on any activity.
|
|
5
|
-
* Notification is received by host and the co-host of the activity.
|
|
6
|
-
* text render only
|
|
7
|
-
* @param {String} user_first_name - first name of the user who posted the question
|
|
8
|
-
* @param {String} sport_name -
|
|
9
|
-
* @param {String} date - Activity's date
|
|
10
|
-
*/
|
|
11
|
-
const query_from_joinee = {
|
|
12
|
-
heading: 'You have a new query! 🧐',
|
|
13
|
-
text: '{{user_first_name}} has a query for your {{sport_name}} game on {{date}}. Tap to respond.',
|
|
14
|
-
buttons: [],
|
|
15
|
-
notificationId: notificationIds.ACTIVITY_QUERY
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Template for sending notification whenever host/ cohost respond to an activity query.
|
|
20
|
-
* Notification is received by OP.
|
|
21
|
-
* text render only
|
|
22
|
-
* @param {String} host_first_name - first name of the host/ cohost who responded to the question
|
|
23
|
-
* @param {String} sport_name -
|
|
24
|
-
* @param {String} date - Activity's date
|
|
25
|
-
*/
|
|
26
|
-
const host_response_to_query = {
|
|
27
|
-
heading: 'Your query has been answered! ✅',
|
|
28
|
-
text: '{{host_first_name}} has responded to your query for the {{sport_name}} game on {{date}}. Tap to read.',
|
|
29
|
-
buttons: [],
|
|
30
|
-
notificationId: notificationIds.ACTIVITY_QUERY_ANSWERED
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Template for sending notification whenever any user sends a request to join any activity.
|
|
35
|
-
* Notification is received by host & / cohost.
|
|
36
|
-
* text render only
|
|
37
|
-
* @param {String} user_first_name - first name of the user who posted the question
|
|
38
|
-
* @param {String} sport_name -
|
|
39
|
-
* @param {String} date - Activity's date
|
|
40
|
-
*/
|
|
41
|
-
const activity_join_request = {
|
|
42
|
-
heading: 'New game request! 🙌',
|
|
43
|
-
text: '{{user_first_name}} has requested to join your {{sport_name}} game happening on {{date}}.',
|
|
44
|
-
additional_message_text: {
|
|
45
|
-
text: 'They have a message for you! Tap to read.',
|
|
46
|
-
default: 'Let them know if you\'re game.'
|
|
47
|
-
},
|
|
48
|
-
buttons: [],
|
|
49
|
-
notificationId: notificationIds.ACTIVITY_REQUEST_MANAGE
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Template for sending notification whenever any host/cohost accepts an user's request to join any activity.
|
|
54
|
-
* Notification is received by the request joinee .
|
|
55
|
-
* heading render also!
|
|
56
|
-
* @param {String} host_first_name - first name of the host/cohost who accepted the request
|
|
57
|
-
* @param {String} sport_name -
|
|
58
|
-
* @param {String} date - Activity's date
|
|
59
|
-
*/
|
|
60
|
-
const activity_request_accepted = {
|
|
61
|
-
heading: 'Request accepted! 🥳',
|
|
62
|
-
text: 'You\'re on for the {{sport_name}} game on {{date}}. You can now chat with your game squad.',
|
|
63
|
-
buttons: [],
|
|
64
|
-
notificationId: notificationIds.ACTIVITY_REQUEST_RESPONSE
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Template for sending notification whenever any host/cohost declines an user's request to join any activity.
|
|
69
|
-
* Notification is received by the request joinee .
|
|
70
|
-
* text render only
|
|
71
|
-
* @param {String} host_first_name - first name of the host/cohost who rejected the request
|
|
72
|
-
* @param {String} sport_name -
|
|
73
|
-
* @param {String} date - Activity's date
|
|
74
|
-
*/
|
|
75
|
-
const activity_request_declined = {
|
|
76
|
-
heading: 'Request declined. 😟',
|
|
77
|
-
text: '{{host_first_name}} declined your request to join the {{sport_name}} game on {{date}}.',
|
|
78
|
-
additional_message_text: {
|
|
79
|
-
text: 'They have a message for you! Tap to read.',
|
|
80
|
-
default: 'No worries, other games are waiting for you! Join them now. 😀'
|
|
81
|
-
},
|
|
82
|
-
buttons: [],
|
|
83
|
-
notificationId: notificationIds.HOST_RETIRED
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Template for sending notification whenever any host/cohost invites an user to join any activity.
|
|
88
|
-
* Notification is received by the requested joinee .
|
|
89
|
-
* text render only
|
|
90
|
-
* @param {String} host_first_name - first name of the host/cohost who invited the user
|
|
91
|
-
* @param {String} sport_name -
|
|
92
|
-
* @param {String} date - Activity's date
|
|
93
|
-
*/
|
|
94
|
-
const user_invited_by_host = {
|
|
95
|
-
heading: 'New game invite! 📩',
|
|
96
|
-
text: '{{host_first_name}} has invited you to the {{sport_name}} game on {{date}}. Are you game? 💪',
|
|
97
|
-
buttons: [],
|
|
98
|
-
notificationId: notificationIds.ACTIVITY_INVITATION
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Template for sending notification whenever any requested joinee accepts the request to join the activity.
|
|
103
|
-
* Notification is received by the host/cohost .
|
|
104
|
-
* text render only
|
|
105
|
-
* @param {String} user_first_name - first name of the user who accepted the request
|
|
106
|
-
* @param {String} sport_name -
|
|
107
|
-
* @param {String} date - Activity's date
|
|
108
|
-
*/
|
|
109
|
-
const user_accepted_invite = {
|
|
110
|
-
heading: 'Game invite accepted! 🤝',
|
|
111
|
-
text: '{{user_first_name}} has accepted your invite for the {{sport_name}} game on {{date}}.',
|
|
112
|
-
buttons: [],
|
|
113
|
-
notificationId: notificationIds.ACTIVITY_INVITATION_RESPONSE
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Template for sending notification whenever any requested joinee declines the request to join the activity.
|
|
118
|
-
* Notification is received by the requested host/cohost .
|
|
119
|
-
* text render only
|
|
120
|
-
* @param {String} user_first_name - first name of the user who rejected the request
|
|
121
|
-
* @param {String} sport_name -
|
|
122
|
-
* @param {String} date - Activity's date
|
|
123
|
-
*/
|
|
124
|
-
const user_declined_invite = {
|
|
125
|
-
heading: 'Game invite declined. 😟',
|
|
126
|
-
text: '{{user_first_name}} has declined your invite for the {{sport_name}} game on {{date}}.',
|
|
127
|
-
additional_message_text: {
|
|
128
|
-
text: 'They have a message for you! Tap to read.',
|
|
129
|
-
default: 'Tap to invite other players.'
|
|
130
|
-
},
|
|
131
|
-
buttons: [],
|
|
132
|
-
notificationId: notificationIds.HOST_RETIRED
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Template for sending notification whenever any host/cohost revokes the request to join the activity.
|
|
137
|
-
* Notification is received by the requested joinee . -- Document wherever it's being used
|
|
138
|
-
* text render only
|
|
139
|
-
* @param {String} host_first_name - first name of the user who cancelled the invite
|
|
140
|
-
* @param {String} sport_name -
|
|
141
|
-
* @param {String} date - Activity's date
|
|
142
|
-
*/
|
|
143
|
-
const host_revoked_invite = {
|
|
144
|
-
heading: 'Game invite cancelled 😕',
|
|
145
|
-
text: '{{host_first_name}} has cancelled your invitation to the {{sport_name}} game on {{date}}.',
|
|
146
|
-
additional_message_text: {
|
|
147
|
-
text: 'They have a message for you! Tap to read.',
|
|
148
|
-
default: 'But, you can always join another game!'
|
|
149
|
-
},
|
|
150
|
-
buttons: [],
|
|
151
|
-
notificationId: notificationIds.HOST_RETIRED
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Template for sending notification whenever any host/cohost retires an user for an activity.
|
|
156
|
-
* Notification is received by the joinee .
|
|
157
|
-
* text render only
|
|
158
|
-
* @param {String} host_first_name - first name of the host/cohost who retired the user
|
|
159
|
-
* @param {String} sport_name -
|
|
160
|
-
* @param {String} date - Activity's date
|
|
161
|
-
*/
|
|
162
|
-
const host_retired_user = {
|
|
163
|
-
heading: 'You have been made to retire.😕',
|
|
164
|
-
text: 'You are no longer a part of {{sport_name}} game on {{date}}.',
|
|
165
|
-
additional_message_text: {
|
|
166
|
-
text: '{{host_first_name}} has a message for you! Tap to read',
|
|
167
|
-
default: 'But, you can always join another game!'
|
|
168
|
-
},
|
|
169
|
-
buttons: [],
|
|
170
|
-
notificationId: notificationIds.HOST_RETIRED
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Template for sending notification whenever any user leaves an activity.
|
|
175
|
-
* Notification is received by the host/cohost .
|
|
176
|
-
* text render only
|
|
177
|
-
* @param {String} user_first_name - first name of the user who left the game
|
|
178
|
-
* @param {String} sport_name -
|
|
179
|
-
* @param {String} date - Activity's date
|
|
180
|
-
*/
|
|
181
|
-
const user_left_game = {
|
|
182
|
-
heading: 'Player has left the game.',
|
|
183
|
-
text: '{{user_first_name}} has left {{date}}\'s {{sport_name}} game.',
|
|
184
|
-
additional_message_text: {
|
|
185
|
-
text: 'They have a message for you! Tap to read.',
|
|
186
|
-
default: 'Tap to invite other players.'
|
|
187
|
-
},
|
|
188
|
-
buttons: [],
|
|
189
|
-
notificationId: notificationIds.HOST_RETIRED
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Template for sending notification whenever any activity is cancelled.
|
|
194
|
-
* Notification is received by all the players of the activity (except the host) .
|
|
195
|
-
* text render only
|
|
196
|
-
* @param {String} host_first_name - first name of the user who left the request
|
|
197
|
-
* @param {String} sport_name -
|
|
198
|
-
* @param {String} date - Activity's date
|
|
199
|
-
*/
|
|
200
|
-
const host_cancelled_activity = {
|
|
201
|
-
heading: 'Oops, your game has been cancelled! 😩',
|
|
202
|
-
text: '{{host_first_name}} has cancelled your {{sport_name}} for {{date}}. Wanna join another game? ',
|
|
203
|
-
buttons: [],
|
|
204
|
-
notificationId: notificationIds.ACTIVITY_CANCEL
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Template for sending activity reminder.
|
|
209
|
-
* Notification is received by all the players of the activity.
|
|
210
|
-
* Text render only
|
|
211
|
-
* @param {String} sport_name
|
|
212
|
-
* @param {String} date
|
|
213
|
-
*/
|
|
214
|
-
const activity_reminder = {
|
|
215
|
-
heading: 'Activity Reminder',
|
|
216
|
-
text: 'You have a {{sport_name}} game coming up at {{date}}. Gear up for some fun!',
|
|
217
|
-
buttons: [],
|
|
218
|
-
notificationId: notificationIds.ACTIVITY_REMINDER
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
const host_updated_activity_details = {
|
|
222
|
-
// ??
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
const host_tagged_venue = {
|
|
226
|
-
// ??
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
const host_booked_venue = {
|
|
230
|
-
// ??
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
const dm_request = {
|
|
234
|
-
heading: 'New message request 💭',
|
|
235
|
-
text: '{{user_name}} has messaged you on Playo. Tap to see.',
|
|
236
|
-
buttons: [],
|
|
237
|
-
notificationId: notificationIds.MESSAGE_REQUEST
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
module.exports = {
|
|
241
|
-
query_from_joinee,
|
|
242
|
-
host_response_to_query,
|
|
243
|
-
activity_join_request,
|
|
244
|
-
activity_request_accepted,
|
|
245
|
-
activity_request_declined,
|
|
246
|
-
user_accepted_invite,
|
|
247
|
-
user_declined_invite,
|
|
248
|
-
user_invited_by_host,
|
|
249
|
-
host_revoked_invite,
|
|
250
|
-
host_retired_user,
|
|
251
|
-
user_left_game,
|
|
252
|
-
host_cancelled_activity,
|
|
253
|
-
activity_reminder,
|
|
254
|
-
dm_request
|
|
1
|
+
const { notificationIds } = require('./notification.config');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Template for sending notification whenever someone posts a questions on any activity.
|
|
5
|
+
* Notification is received by host and the co-host of the activity.
|
|
6
|
+
* text render only
|
|
7
|
+
* @param {String} user_first_name - first name of the user who posted the question
|
|
8
|
+
* @param {String} sport_name -
|
|
9
|
+
* @param {String} date - Activity's date
|
|
10
|
+
*/
|
|
11
|
+
const query_from_joinee = {
|
|
12
|
+
heading: 'You have a new query! 🧐',
|
|
13
|
+
text: '{{user_first_name}} has a query for your {{sport_name}} game on {{date}}. Tap to respond.',
|
|
14
|
+
buttons: [],
|
|
15
|
+
notificationId: notificationIds.ACTIVITY_QUERY
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Template for sending notification whenever host/ cohost respond to an activity query.
|
|
20
|
+
* Notification is received by OP.
|
|
21
|
+
* text render only
|
|
22
|
+
* @param {String} host_first_name - first name of the host/ cohost who responded to the question
|
|
23
|
+
* @param {String} sport_name -
|
|
24
|
+
* @param {String} date - Activity's date
|
|
25
|
+
*/
|
|
26
|
+
const host_response_to_query = {
|
|
27
|
+
heading: 'Your query has been answered! ✅',
|
|
28
|
+
text: '{{host_first_name}} has responded to your query for the {{sport_name}} game on {{date}}. Tap to read.',
|
|
29
|
+
buttons: [],
|
|
30
|
+
notificationId: notificationIds.ACTIVITY_QUERY_ANSWERED
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Template for sending notification whenever any user sends a request to join any activity.
|
|
35
|
+
* Notification is received by host & / cohost.
|
|
36
|
+
* text render only
|
|
37
|
+
* @param {String} user_first_name - first name of the user who posted the question
|
|
38
|
+
* @param {String} sport_name -
|
|
39
|
+
* @param {String} date - Activity's date
|
|
40
|
+
*/
|
|
41
|
+
const activity_join_request = {
|
|
42
|
+
heading: 'New game request! 🙌',
|
|
43
|
+
text: '{{user_first_name}} has requested to join your {{sport_name}} game happening on {{date}}.',
|
|
44
|
+
additional_message_text: {
|
|
45
|
+
text: 'They have a message for you! Tap to read.',
|
|
46
|
+
default: 'Let them know if you\'re game.'
|
|
47
|
+
},
|
|
48
|
+
buttons: [],
|
|
49
|
+
notificationId: notificationIds.ACTIVITY_REQUEST_MANAGE
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Template for sending notification whenever any host/cohost accepts an user's request to join any activity.
|
|
54
|
+
* Notification is received by the request joinee .
|
|
55
|
+
* heading render also!
|
|
56
|
+
* @param {String} host_first_name - first name of the host/cohost who accepted the request
|
|
57
|
+
* @param {String} sport_name -
|
|
58
|
+
* @param {String} date - Activity's date
|
|
59
|
+
*/
|
|
60
|
+
const activity_request_accepted = {
|
|
61
|
+
heading: 'Request accepted! 🥳',
|
|
62
|
+
text: 'You\'re on for the {{sport_name}} game on {{date}}. You can now chat with your game squad.',
|
|
63
|
+
buttons: [],
|
|
64
|
+
notificationId: notificationIds.ACTIVITY_REQUEST_RESPONSE
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Template for sending notification whenever any host/cohost declines an user's request to join any activity.
|
|
69
|
+
* Notification is received by the request joinee .
|
|
70
|
+
* text render only
|
|
71
|
+
* @param {String} host_first_name - first name of the host/cohost who rejected the request
|
|
72
|
+
* @param {String} sport_name -
|
|
73
|
+
* @param {String} date - Activity's date
|
|
74
|
+
*/
|
|
75
|
+
const activity_request_declined = {
|
|
76
|
+
heading: 'Request declined. 😟',
|
|
77
|
+
text: '{{host_first_name}} declined your request to join the {{sport_name}} game on {{date}}.',
|
|
78
|
+
additional_message_text: {
|
|
79
|
+
text: 'They have a message for you! Tap to read.',
|
|
80
|
+
default: 'No worries, other games are waiting for you! Join them now. 😀'
|
|
81
|
+
},
|
|
82
|
+
buttons: [],
|
|
83
|
+
notificationId: notificationIds.HOST_RETIRED
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Template for sending notification whenever any host/cohost invites an user to join any activity.
|
|
88
|
+
* Notification is received by the requested joinee .
|
|
89
|
+
* text render only
|
|
90
|
+
* @param {String} host_first_name - first name of the host/cohost who invited the user
|
|
91
|
+
* @param {String} sport_name -
|
|
92
|
+
* @param {String} date - Activity's date
|
|
93
|
+
*/
|
|
94
|
+
const user_invited_by_host = {
|
|
95
|
+
heading: 'New game invite! 📩',
|
|
96
|
+
text: '{{host_first_name}} has invited you to the {{sport_name}} game on {{date}}. Are you game? 💪',
|
|
97
|
+
buttons: [],
|
|
98
|
+
notificationId: notificationIds.ACTIVITY_INVITATION
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Template for sending notification whenever any requested joinee accepts the request to join the activity.
|
|
103
|
+
* Notification is received by the host/cohost .
|
|
104
|
+
* text render only
|
|
105
|
+
* @param {String} user_first_name - first name of the user who accepted the request
|
|
106
|
+
* @param {String} sport_name -
|
|
107
|
+
* @param {String} date - Activity's date
|
|
108
|
+
*/
|
|
109
|
+
const user_accepted_invite = {
|
|
110
|
+
heading: 'Game invite accepted! 🤝',
|
|
111
|
+
text: '{{user_first_name}} has accepted your invite for the {{sport_name}} game on {{date}}.',
|
|
112
|
+
buttons: [],
|
|
113
|
+
notificationId: notificationIds.ACTIVITY_INVITATION_RESPONSE
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Template for sending notification whenever any requested joinee declines the request to join the activity.
|
|
118
|
+
* Notification is received by the requested host/cohost .
|
|
119
|
+
* text render only
|
|
120
|
+
* @param {String} user_first_name - first name of the user who rejected the request
|
|
121
|
+
* @param {String} sport_name -
|
|
122
|
+
* @param {String} date - Activity's date
|
|
123
|
+
*/
|
|
124
|
+
const user_declined_invite = {
|
|
125
|
+
heading: 'Game invite declined. 😟',
|
|
126
|
+
text: '{{user_first_name}} has declined your invite for the {{sport_name}} game on {{date}}.',
|
|
127
|
+
additional_message_text: {
|
|
128
|
+
text: 'They have a message for you! Tap to read.',
|
|
129
|
+
default: 'Tap to invite other players.'
|
|
130
|
+
},
|
|
131
|
+
buttons: [],
|
|
132
|
+
notificationId: notificationIds.HOST_RETIRED
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Template for sending notification whenever any host/cohost revokes the request to join the activity.
|
|
137
|
+
* Notification is received by the requested joinee . -- Document wherever it's being used
|
|
138
|
+
* text render only
|
|
139
|
+
* @param {String} host_first_name - first name of the user who cancelled the invite
|
|
140
|
+
* @param {String} sport_name -
|
|
141
|
+
* @param {String} date - Activity's date
|
|
142
|
+
*/
|
|
143
|
+
const host_revoked_invite = {
|
|
144
|
+
heading: 'Game invite cancelled 😕',
|
|
145
|
+
text: '{{host_first_name}} has cancelled your invitation to the {{sport_name}} game on {{date}}.',
|
|
146
|
+
additional_message_text: {
|
|
147
|
+
text: 'They have a message for you! Tap to read.',
|
|
148
|
+
default: 'But, you can always join another game!'
|
|
149
|
+
},
|
|
150
|
+
buttons: [],
|
|
151
|
+
notificationId: notificationIds.HOST_RETIRED
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Template for sending notification whenever any host/cohost retires an user for an activity.
|
|
156
|
+
* Notification is received by the joinee .
|
|
157
|
+
* text render only
|
|
158
|
+
* @param {String} host_first_name - first name of the host/cohost who retired the user
|
|
159
|
+
* @param {String} sport_name -
|
|
160
|
+
* @param {String} date - Activity's date
|
|
161
|
+
*/
|
|
162
|
+
const host_retired_user = {
|
|
163
|
+
heading: 'You have been made to retire.😕',
|
|
164
|
+
text: 'You are no longer a part of {{sport_name}} game on {{date}}.',
|
|
165
|
+
additional_message_text: {
|
|
166
|
+
text: '{{host_first_name}} has a message for you! Tap to read',
|
|
167
|
+
default: 'But, you can always join another game!'
|
|
168
|
+
},
|
|
169
|
+
buttons: [],
|
|
170
|
+
notificationId: notificationIds.HOST_RETIRED
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Template for sending notification whenever any user leaves an activity.
|
|
175
|
+
* Notification is received by the host/cohost .
|
|
176
|
+
* text render only
|
|
177
|
+
* @param {String} user_first_name - first name of the user who left the game
|
|
178
|
+
* @param {String} sport_name -
|
|
179
|
+
* @param {String} date - Activity's date
|
|
180
|
+
*/
|
|
181
|
+
const user_left_game = {
|
|
182
|
+
heading: 'Player has left the game.',
|
|
183
|
+
text: '{{user_first_name}} has left {{date}}\'s {{sport_name}} game.',
|
|
184
|
+
additional_message_text: {
|
|
185
|
+
text: 'They have a message for you! Tap to read.',
|
|
186
|
+
default: 'Tap to invite other players.'
|
|
187
|
+
},
|
|
188
|
+
buttons: [],
|
|
189
|
+
notificationId: notificationIds.HOST_RETIRED
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Template for sending notification whenever any activity is cancelled.
|
|
194
|
+
* Notification is received by all the players of the activity (except the host) .
|
|
195
|
+
* text render only
|
|
196
|
+
* @param {String} host_first_name - first name of the user who left the request
|
|
197
|
+
* @param {String} sport_name -
|
|
198
|
+
* @param {String} date - Activity's date
|
|
199
|
+
*/
|
|
200
|
+
const host_cancelled_activity = {
|
|
201
|
+
heading: 'Oops, your game has been cancelled! 😩',
|
|
202
|
+
text: '{{host_first_name}} has cancelled your {{sport_name}} for {{date}}. Wanna join another game? ',
|
|
203
|
+
buttons: [],
|
|
204
|
+
notificationId: notificationIds.ACTIVITY_CANCEL
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Template for sending activity reminder.
|
|
209
|
+
* Notification is received by all the players of the activity.
|
|
210
|
+
* Text render only
|
|
211
|
+
* @param {String} sport_name
|
|
212
|
+
* @param {String} date
|
|
213
|
+
*/
|
|
214
|
+
const activity_reminder = {
|
|
215
|
+
heading: 'Activity Reminder',
|
|
216
|
+
text: 'You have a {{sport_name}} game coming up at {{date}}. Gear up for some fun!',
|
|
217
|
+
buttons: [],
|
|
218
|
+
notificationId: notificationIds.ACTIVITY_REMINDER
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const host_updated_activity_details = {
|
|
222
|
+
// ??
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
const host_tagged_venue = {
|
|
226
|
+
// ??
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const host_booked_venue = {
|
|
230
|
+
// ??
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
const dm_request = {
|
|
234
|
+
heading: 'New message request 💭',
|
|
235
|
+
text: '{{user_name}} has messaged you on Playo. Tap to see.',
|
|
236
|
+
buttons: [],
|
|
237
|
+
notificationId: notificationIds.MESSAGE_REQUEST
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
module.exports = {
|
|
241
|
+
query_from_joinee,
|
|
242
|
+
host_response_to_query,
|
|
243
|
+
activity_join_request,
|
|
244
|
+
activity_request_accepted,
|
|
245
|
+
activity_request_declined,
|
|
246
|
+
user_accepted_invite,
|
|
247
|
+
user_declined_invite,
|
|
248
|
+
user_invited_by_host,
|
|
249
|
+
host_revoked_invite,
|
|
250
|
+
host_retired_user,
|
|
251
|
+
user_left_game,
|
|
252
|
+
host_cancelled_activity,
|
|
253
|
+
activity_reminder,
|
|
254
|
+
dm_request
|
|
255
255
|
}
|