playov2-js-utilities 0.3.2 → 0.3.3
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/notification-templates.js +18 -18
- package/package.json +1 -1
- package/test.js +5 -216
|
@@ -39,10 +39,10 @@ const host_response_to_query = {
|
|
|
39
39
|
* @param {String} date - Activity's date
|
|
40
40
|
*/
|
|
41
41
|
const activity_join_request = {
|
|
42
|
-
heading: '
|
|
42
|
+
heading: 'New game request! 🙌',
|
|
43
43
|
text: '{{user_first_name}} has requested to join your {{sport_name}} game happening on {{date}}.',
|
|
44
44
|
additional_message_text: {
|
|
45
|
-
text: 'They have a message for you! Tap to read',
|
|
45
|
+
text: 'They have a message for you! Tap to read.',
|
|
46
46
|
default: 'Let them know if you\'re game.'
|
|
47
47
|
},
|
|
48
48
|
buttons: [],
|
|
@@ -58,7 +58,7 @@ const activity_join_request = {
|
|
|
58
58
|
* @param {String} date - Activity's date
|
|
59
59
|
*/
|
|
60
60
|
const activity_request_accepted = {
|
|
61
|
-
heading: '
|
|
61
|
+
heading: 'Request accepted! 🥳',
|
|
62
62
|
text: 'You\'re on for the {{sport_name}} game on {{date}}. You can now chat with your game squad.',
|
|
63
63
|
buttons: [],
|
|
64
64
|
notificationId: notificationIds.ACTIVITY_REQUEST_RESPONSE
|
|
@@ -73,11 +73,11 @@ const activity_request_accepted = {
|
|
|
73
73
|
* @param {String} date - Activity's date
|
|
74
74
|
*/
|
|
75
75
|
const activity_request_declined = {
|
|
76
|
-
heading: '
|
|
76
|
+
heading: 'Request declined. 😟',
|
|
77
77
|
text: '{{host_first_name}} declined your request to join the {{sport_name}} game on {{date}}.',
|
|
78
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
|
|
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
81
|
},
|
|
82
82
|
buttons: [],
|
|
83
83
|
notificationId: notificationIds.HOST_RETIRED
|
|
@@ -92,7 +92,7 @@ const activity_request_declined = {
|
|
|
92
92
|
* @param {String} date - Activity's date
|
|
93
93
|
*/
|
|
94
94
|
const user_invited_by_host = {
|
|
95
|
-
heading: '
|
|
95
|
+
heading: 'New game invite! 📩',
|
|
96
96
|
text: '{{host_first_name}} has invited you to the {{sport_name}} game on {{date}}. Are you game? 💪',
|
|
97
97
|
buttons: [],
|
|
98
98
|
notificationId: notificationIds.ACTIVITY_INVITATION
|
|
@@ -107,8 +107,8 @@ const user_invited_by_host = {
|
|
|
107
107
|
* @param {String} date - Activity's date
|
|
108
108
|
*/
|
|
109
109
|
const user_accepted_invite = {
|
|
110
|
-
heading: '
|
|
111
|
-
text: '{{user_first_name}} has accepted your
|
|
110
|
+
heading: 'Game invite accepted! 🤝',
|
|
111
|
+
text: '{{user_first_name}} has accepted your invite for the {{sport_name}} game on {{date}}.',
|
|
112
112
|
buttons: [],
|
|
113
113
|
notificationId: notificationIds.ACTIVITY_INVITATION_RESPONSE
|
|
114
114
|
};
|
|
@@ -122,11 +122,11 @@ const user_accepted_invite = {
|
|
|
122
122
|
* @param {String} date - Activity's date
|
|
123
123
|
*/
|
|
124
124
|
const user_declined_invite = {
|
|
125
|
-
heading: '
|
|
126
|
-
text: '{{user_first_name}} has declined your
|
|
125
|
+
heading: 'Game invite declined. 😟',
|
|
126
|
+
text: '{{user_first_name}} has declined your invite for the {{sport_name}} game on {{date}}.',
|
|
127
127
|
additional_message_text: {
|
|
128
|
-
text: 'They have a message for you! Tap to read',
|
|
129
|
-
default: ''
|
|
128
|
+
text: 'They have a message for you! Tap to read.',
|
|
129
|
+
default: 'Tap to invite other players.'
|
|
130
130
|
},
|
|
131
131
|
buttons: [],
|
|
132
132
|
notificationId: notificationIds.HOST_RETIRED
|
|
@@ -141,10 +141,10 @@ const user_declined_invite = {
|
|
|
141
141
|
* @param {String} date - Activity's date
|
|
142
142
|
*/
|
|
143
143
|
const host_revoked_invite = {
|
|
144
|
-
heading: '
|
|
144
|
+
heading: 'Game invite cancelled 😕',
|
|
145
145
|
text: '{{host_first_name}} has cancelled your invitation to the {{sport_name}} game on {{date}}.',
|
|
146
146
|
additional_message_text: {
|
|
147
|
-
text: 'They have a message for you! Tap to read',
|
|
147
|
+
text: 'They have a message for you! Tap to read.',
|
|
148
148
|
default: 'But, you can always join another game!'
|
|
149
149
|
},
|
|
150
150
|
buttons: [],
|
|
@@ -160,7 +160,7 @@ const host_revoked_invite = {
|
|
|
160
160
|
* @param {String} date - Activity's date
|
|
161
161
|
*/
|
|
162
162
|
const host_retired_user = {
|
|
163
|
-
heading: 'You have been made to retire
|
|
163
|
+
heading: 'You have been made to retire.😕',
|
|
164
164
|
text: 'You are no longer a part of {{sport_name}} game on {{date}}.',
|
|
165
165
|
additional_message_text: {
|
|
166
166
|
text: '{{host_first_name}} has a message for you! Tap to read',
|
|
@@ -182,8 +182,8 @@ const user_left_game = {
|
|
|
182
182
|
heading: 'Player has left the game.',
|
|
183
183
|
text: '{{user_first_name}} has left {{date}}\'s {{sport_name}} game.',
|
|
184
184
|
additional_message_text: {
|
|
185
|
-
text: '
|
|
186
|
-
default: ''
|
|
185
|
+
text: 'They have a message for you! Tap to read.',
|
|
186
|
+
default: 'Tap to invite other players.'
|
|
187
187
|
},
|
|
188
188
|
buttons: [],
|
|
189
189
|
notificationId: notificationIds.HOST_RETIRED
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -1,219 +1,8 @@
|
|
|
1
|
-
const data =[
|
|
2
|
-
|
|
3
|
-
"_id": "619b64773f930c6f90778f93",
|
|
4
|
-
"location": "Indiranagar",
|
|
5
|
-
"hostId": "1b7887d3-8255-409b-9efe-89b64b701862",
|
|
6
|
-
"matchHappened": true,
|
|
7
|
-
"matchRating": -1,
|
|
8
|
-
"userPlayed": true,
|
|
9
|
-
"expired": false,
|
|
10
|
-
"cancelled": false,
|
|
11
|
-
"noshow": false,
|
|
12
|
-
"removed": false,
|
|
13
|
-
"userId": "1b7887d3-8255-409b-9efe-89b64b701862",
|
|
14
|
-
"activityId": "9a8942e0-9778-4c43-befd-c8f7de4d3985",
|
|
15
|
-
"sportId": "SP5",
|
|
16
|
-
"date": "2021-11-22T00:00:00.000Z",
|
|
17
|
-
"timing": 2,
|
|
18
|
-
"pals": [
|
|
19
|
-
{
|
|
20
|
-
"noshow": false,
|
|
21
|
-
"noshowSwitch": false,
|
|
22
|
-
"rating": 5,
|
|
23
|
-
"newPlaypal": false,
|
|
24
|
-
"firstRatedOn": "2021-11-22T09:36:09.000Z",
|
|
25
|
-
"isRemoved": false,
|
|
26
|
-
"userPresent": null,
|
|
27
|
-
"palId": "2537e208-35f2-4b38-ac65-081ab1a249be",
|
|
28
|
-
"reputation": [
|
|
29
|
-
{
|
|
30
|
-
"reputationId": 0,
|
|
31
|
-
"value": -1
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"reputationId": 1,
|
|
35
|
-
"value": -1
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"reputationId": 2,
|
|
39
|
-
"value": -1
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
"timestamp": "2021-11-22T09:59:37.000Z"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"createdTS": "2021-11-22T09:35:51.009Z",
|
|
46
|
-
"modTS": "2021-11-22T09:59:37.512Z",
|
|
47
|
-
"__v": 0
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"_id": "619b6c5b8fff1950a20adae1",
|
|
51
|
-
"location": "Jayanagar, Bengaluru",
|
|
52
|
-
"hostId": "a458fa2e-37e8-4e9d-beb1-3b4e68e5d56e",
|
|
53
|
-
"matchHappened": true,
|
|
54
|
-
"matchRating": -1,
|
|
55
|
-
"userPlayed": true,
|
|
56
|
-
"expired": true,
|
|
57
|
-
"cancelled": false,
|
|
58
|
-
"noshow": false,
|
|
59
|
-
"removed": false,
|
|
60
|
-
"userId": "1b7887d3-8255-409b-9efe-89b64b701862",
|
|
61
|
-
"activityId": "5161229a-e82d-498a-beed-8e2bc50bcaf7",
|
|
62
|
-
"sportId": "SP5",
|
|
63
|
-
"date": "2021-11-22T00:00:00.000Z",
|
|
64
|
-
"timing": 1,
|
|
65
|
-
"pals": [
|
|
66
|
-
{
|
|
67
|
-
"noshow": false,
|
|
68
|
-
"noshowSwitch": false,
|
|
69
|
-
"rating": 0,
|
|
70
|
-
"newPlaypal": false,
|
|
71
|
-
"isRemoved": false,
|
|
72
|
-
"userPresent": null,
|
|
73
|
-
"palId": "a458fa2e-37e8-4e9d-beb1-3b4e68e5d56e",
|
|
74
|
-
"reputation": [
|
|
75
|
-
{
|
|
76
|
-
"reputationId": 0,
|
|
77
|
-
"value": -1
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"reputationId": 1,
|
|
81
|
-
"value": -1
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"reputationId": 2,
|
|
85
|
-
"value": -1
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
"timestamp": "2021-11-22T10:09:31.718Z"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"noshow": false,
|
|
92
|
-
"noshowSwitch": false,
|
|
93
|
-
"rating": 4,
|
|
94
|
-
"newPlaypal": false,
|
|
95
|
-
"isRemoved": false,
|
|
96
|
-
"userPresent": null,
|
|
97
|
-
"palId": "2537e208-35f2-4b38-ac65-081ab1a249be",
|
|
98
|
-
"reputation": [
|
|
99
|
-
{
|
|
100
|
-
"reputationId": 0,
|
|
101
|
-
"value": -1
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"reputationId": 1,
|
|
105
|
-
"value": -1
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"reputationId": 2,
|
|
109
|
-
"value": -1
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
"timestamp": "2021-11-22T11:22:05.000Z"
|
|
113
|
-
}
|
|
114
|
-
],
|
|
115
|
-
"createdTS": "2021-11-22T10:09:31.718Z",
|
|
116
|
-
"modTS": "2021-11-22T11:26:49.742Z",
|
|
117
|
-
"__v": 0
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"_id": "619b85378fff1950a20adaed",
|
|
121
|
-
"location": "Indiranagar",
|
|
122
|
-
"hostId": "1b7887d3-8255-409b-9efe-89b64b701862",
|
|
123
|
-
"matchHappened": true,
|
|
124
|
-
"matchRating": -1,
|
|
125
|
-
"userPlayed": true,
|
|
126
|
-
"expired": false,
|
|
127
|
-
"cancelled": false,
|
|
128
|
-
"noshow": false,
|
|
129
|
-
"removed": false,
|
|
130
|
-
"userId": "1b7887d3-8255-409b-9efe-89b64b701862",
|
|
131
|
-
"activityId": "00f9ff64-214c-470d-b7fb-760a6a3af8e0",
|
|
132
|
-
"sportId": "SP5",
|
|
133
|
-
"date": "2021-11-22T00:00:00.000Z",
|
|
134
|
-
"timing": 2,
|
|
135
|
-
"pals": [
|
|
136
|
-
{
|
|
137
|
-
"noshow": true,
|
|
138
|
-
"noshowSwitch": false,
|
|
139
|
-
"rating": 0,
|
|
140
|
-
"newPlaypal": false,
|
|
141
|
-
"firstRatedOn": null,
|
|
142
|
-
"isRemoved": false,
|
|
143
|
-
"userPresent": null,
|
|
144
|
-
"palId": "a458fa2e-37e8-4e9d-beb1-3b4e68e5d56e",
|
|
145
|
-
"reputation": [
|
|
146
|
-
{
|
|
147
|
-
"reputationId": 0,
|
|
148
|
-
"value": -1
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
"reputationId": 1,
|
|
152
|
-
"value": -1
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"reputationId": 2,
|
|
156
|
-
"value": -1
|
|
157
|
-
}
|
|
158
|
-
],
|
|
159
|
-
"timestamp": "2021-11-22T11:55:35.341Z"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"noshow": false,
|
|
163
|
-
"noshowSwitch": false,
|
|
164
|
-
"rating": 0,
|
|
165
|
-
"newPlaypal": false,
|
|
166
|
-
"firstRatedOn": null,
|
|
167
|
-
"isRemoved": false,
|
|
168
|
-
"userPresent": null,
|
|
169
|
-
"palId": "88d8e6ed-207a-4b98-ace7-73a7bd6bc900",
|
|
170
|
-
"reputation": [
|
|
171
|
-
{
|
|
172
|
-
"reputationId": 0,
|
|
173
|
-
"value": -1
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"reputationId": 1,
|
|
177
|
-
"value": -1
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
"reputationId": 2,
|
|
181
|
-
"value": -1
|
|
182
|
-
}
|
|
183
|
-
],
|
|
184
|
-
"timestamp": "2021-11-22T11:55:35.341Z"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"noshow": true,
|
|
188
|
-
"noshowSwitch": false,
|
|
189
|
-
"rating": 0,
|
|
190
|
-
"newPlaypal": false,
|
|
191
|
-
"firstRatedOn": null,
|
|
192
|
-
"isRemoved": false,
|
|
193
|
-
"userPresent": null,
|
|
194
|
-
"palId": "2537e208-35f2-4b38-ac65-081ab1a249be",
|
|
195
|
-
"reputation": [
|
|
196
|
-
{
|
|
197
|
-
"reputationId": 0,
|
|
198
|
-
"value": 1
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
"reputationId": 1,
|
|
202
|
-
"value": 1
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"reputationId": 2,
|
|
206
|
-
"value": 1
|
|
207
|
-
}
|
|
208
|
-
],
|
|
209
|
-
"timestamp": "2021-11-22T11:55:35.341Z"
|
|
210
|
-
}
|
|
211
|
-
]
|
|
212
|
-
}
|
|
213
|
-
];
|
|
214
|
-
const ratingTest = require('./lib/ratings/index');
|
|
1
|
+
const data = [{"_id":"619b64773f930c6f90778f94","location":"Indiranagar","hostId":"1b7887d3-8255-409b-9efe-89b64b701862","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":false,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"9a8942e0-9778-4c43-befd-c8f7de4d3985","sportId":"SP5","date":"2021-11-22T00:00:00.000Z","timing":2,"pals":[{"noshow":false,"noshowSwitch":false,"rating":5,"newPlaypal":false,"firstRatedOn":"2021-11-22T09:36:20.000Z","isRemoved":false,"userPresent":null,"palId":"1b7887d3-8255-409b-9efe-89b64b701862","reputation":[{"reputationId":0,"value":1},{"reputationId":1,"value":1},{"reputationId":2,"value":1}],"timestamp":"2021-11-22T09:36:20.000Z"}],"createdTS":"2021-11-22T09:35:51.013Z","modTS":"2021-11-22T09:36:20.095Z","__v":0},{"_id":"619b6c5b8fff1950a20adae2","location":"Jayanagar, Bengaluru","hostId":"a458fa2e-37e8-4e9d-beb1-3b4e68e5d56e","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"5161229a-e82d-498a-beed-8e2bc50bcaf7","sportId":"SP5","date":"2021-11-22T00:00:00.000Z","timing":1,"pals":[{"noshow":false,"noshowSwitch":false,"rating":0,"newPlaypal":false,"isRemoved":false,"userPresent":null,"palId":"a458fa2e-37e8-4e9d-beb1-3b4e68e5d56e","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-11-22T10:09:31.719Z"},{"noshow":false,"noshowSwitch":false,"rating":5,"newPlaypal":false,"isRemoved":false,"userPresent":null,"palId":"1b7887d3-8255-409b-9efe-89b64b701862","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-11-22T10:24:02.000Z"}],"createdTS":"2021-11-22T10:09:31.719Z","modTS":"2021-11-22T11:26:49.742Z","__v":0},{"_id":"619b85378fff1950a20adaf0","location":"Indiranagar","hostId":"1b7887d3-8255-409b-9efe-89b64b701862","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"00f9ff64-214c-470d-b7fb-760a6a3af8e0","sportId":"SP5","date":"2021-11-22T00:00:00.000Z","timing":2,"pals":[{"noshow":false,"noshowSwitch":false,"rating":0,"newPlaypal":false,"isRemoved":false,"userPresent":null,"palId":"1b7887d3-8255-409b-9efe-89b64b701862","reputation":[{"reputationId":0,"value":1},{"reputationId":1,"value":1},{"reputationId":2,"value":1}],"timestamp":"2021-11-22T12:00:26.000Z"},{"noshow":false,"noshowSwitch":false,"rating":3,"newPlaypal":false,"isRemoved":false,"userPresent":null,"palId":"a458fa2e-37e8-4e9d-beb1-3b4e68e5d56e","reputation":[{"reputationId":0,"value":1},{"reputationId":1,"value":1},{"reputationId":2,"value":1}],"timestamp":"2021-11-22T12:02:57.000Z"},{"noshow":false,"noshowSwitch":false,"rating":0,"newPlaypal":false,"isRemoved":false,"userPresent":null,"palId":"88d8e6ed-207a-4b98-ace7-73a7bd6bc900","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-11-22T11:55:35.344Z"}],"createdTS":"2021-11-22T11:55:35.345Z","modTS":"2021-11-22T12:09:46.320Z","__v":0},{"_id":"612502919345581b9bd0246b","location":"Maker, Bihar, India","hostId":"65a91715-396c-4049-a952-2cc56a100f4a","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"4dbf9ef5-c3a7-4542-8a6d-9241a02b4965","sportId":"SP5","date":"2021-08-24T00:00:00.000Z","timing":2,"pals":[{"noshow":false,"noshowSwitch":false,"rating":0,"newPlaypal":true,"isRemoved":false,"userPresent":null,"palId":"65a91715-396c-4049-a952-2cc56a100f4a","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-08-24T14:30:41.439Z"},{"noshow":false,"noshowSwitch":false,"rating":5,"newPlaypal":false,"isRemoved":false,"userPresent":null,"palId":"a458fa2e-37e8-4e9d-beb1-3b4e68e5d56e","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-08-24T14:31:01.000Z"},{"noshow":false,"noshowSwitch":false,"rating":0,"newPlaypal":false,"isRemoved":true,"userPresent":null,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-08-24T14:30:41.439Z","userName":"playo user"}],"createdTS":"2021-08-24T14:30:41.439Z","modTS":"2021-11-18T07:03:29.356Z","__v":0},{"_id":"6038ffa7cc84a76c119f1333","location":"Maker, Bihar","hostId":"d1ba3771-0255-41bf-9889-e222c97e986b","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"a1c4ae44-2667-42f9-ac37-dd173b2fa3b1","sportId":"SP5","date":"2021-02-26T00:00:00.000Z","startTime":"2021-02-26T14:00:00.916Z","endTime":"2021-02-26T14:30:00.916Z","timing":2,"pals":[{"noshow":false,"noshowSwitch":false,"rating":0,"newPlaypal":false,"isRemoved":true,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-02-26T14:03:19.486Z","userName":"playo user"},{"noshow":false,"noshowSwitch":false,"rating":0,"newPlaypal":false,"isRemoved":true,"palId":"54fe8420-dae7-4bb2-aa08-320b7dc40794","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-02-26T14:03:19.485Z","userName":"playo user"},{"noshow":false,"noshowSwitch":false,"rating":5,"newPlaypal":false,"isRemoved":false,"palId":"a458fa2e-37e8-4e9d-beb1-3b4e68e5d56e","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-02-26T14:04:25.000Z"}],"createdTS":"2021-02-26T14:03:19.486Z","modTS":"2021-11-18T07:09:26.826Z","__v":0},{"_id":"6015a56cc8be9072376d7f0d","location":"Maker, Bihar","hostId":"d1ba3771-0255-41bf-9889-e222c97e986b","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"00879220-bd24-4635-add2-ce4b997be0fe","sportId":"SP5","date":"2021-01-30T00:00:00.000Z","timing":3,"pals":[{"noshow":false,"noshowSwitch":false,"rating":4,"newPlaypal":false,"firstRatedOn":"2021-02-02T13:36:32.000Z","isRemoved":true,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":1},{"reputationId":1,"value":1},{"reputationId":2,"value":1}],"timestamp":"2021-02-02T13:36:32.000Z","userName":"playo user"},{"noshow":false,"noshowSwitch":false,"rating":0,"newPlaypal":false,"firstRatedOn":null,"isRemoved":false,"palId":"da0df07e-5cdb-4cbc-9b47-a31812aa3be7","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-01-30T18:29:00.257Z"},{"noshow":false,"noshowSwitch":false,"rating":2,"newPlaypal":false,"firstRatedOn":"2021-02-02T14:00:09.000Z","isRemoved":true,"palId":"54fe8420-dae7-4bb2-aa08-320b7dc40794","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-02-02T14:00:09.000Z","userName":"playo user"}],"createdTS":"2021-01-30T18:29:00.258Z","modTS":"2021-11-18T07:09:26.826Z","__v":0},{"_id":"5f9c32a49739b90adc3579b0","location":"BTM Layout","hostId":"d1ba3771-0255-41bf-9889-e222c97e986b","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"d3e71dc8-1aa6-4e32-b10d-50d4b084df31","sportId":"SP5","date":"2020-10-30T00:00:00.000Z","timing":2,"pals":[{"noshow":false,"noshowSwitch":false,"rating":1,"newPlaypal":false,"firstRatedOn":"2021-02-03T08:19:09.000Z","isRemoved":true,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":0},{"reputationId":1,"value":0},{"reputationId":2,"value":0}],"timestamp":"2021-02-03T08:20:04.000Z","userName":"playo user"}],"createdTS":"2020-10-30T15:35:00.552Z","modTS":"2021-11-18T07:03:29.356Z","__v":0},{"_id":"5f9c32a49739b90adc3579b2","location":"BTM Layout, Bengaluru","hostId":"54fe8420-dae7-4bb2-aa08-320b7dc40794","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"1d624dfb-38aa-423d-b587-868740d9b5b7","sportId":"SP5","date":"2020-10-30T00:00:00.000Z","timing":2,"pals":[{"noshow":false,"noshowSwitch":false,"rating":3,"newPlaypal":false,"isRemoved":true,"palId":"54fe8420-dae7-4bb2-aa08-320b7dc40794","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-02-03T08:19:52.000Z","firstRatedOn":"2021-02-03T08:19:52.000Z","userName":"playo user"}],"createdTS":"2020-10-30T15:35:00.562Z","modTS":"2021-11-18T07:09:26.826Z","__v":0},{"_id":"5f6e0e24b61c8b4468f21759","location":"Qatar - Dubai - United Arab Emirates","hostId":"d1ba3771-0255-41bf-9889-e222c97e986b","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"26927e38-56de-4b2e-8c57-dd01abe8109f","sportId":"SP5","date":"2020-09-25T00:00:00.000Z","timing":2,"pals":[{"noshow":false,"noshowSwitch":false,"rating":5,"newPlaypal":false,"isRemoved":true,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2020-09-27T12:28:45.000Z","userName":"playo user"}]
|
|
2
|
+
,"createdTS":"2020-09-25T15:35:00.313Z","modTS":"2021-11-18T07:03:29.356Z","__v":0},{"_id":"5efaf808a4b1425a240c2a85","location":"Dribble Arena, Magrath Road","hostId":"2537e208-35f2-4b38-ac65-081ab1a249be","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"7176dd7c-8424-43b8-95f4-a21148141bae","sportId":"SP5","date":"2020-06-30T00:00:00.000Z","startTime":"2020-06-30T07:30:00.000Z","endTime":"2020-06-30T08:30:00.000Z","timing":1,"pals":[{"noshow":false,"noshowSwitch":false,"rating":3,"newPlaypal":false,"firstRatedOn":"2020-07-02T12:52:32.000Z","isRemoved":true,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":1},{"reputationId":1,"value":0},{"reputationId":2,"value":1}],"timestamp":"2020-07-02T12:57:53.000Z","userName":"playo user"}],"createdTS":"2020-06-30T08:30:00.348Z","modTS":"2021-11-18T07:03:29.356Z","__v":0},{"_id":"5ee10a8a9a0d8d7d0c611715","location":"Dribble Arena Test,Indiranagar","hostId":"d1ba3771-0255-41bf-9889-e222c97e986b","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"17266219-0b62-4edc-acd3-5775379e7143","sportId":"SP5","date":"2020-06-10T00:00:00.000Z","startTime":"2020-06-10T15:30:00.000Z","endTime":"2020-06-10T16:30:00.000Z","timing":3,"pals":[{"noshow":false,"noshowSwitch":false,"rating":4,"newPlaypal":false,"isRemoved":true,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2020-06-11T04:30:06.000Z","userName":"playo user"}],"createdTS":"2020-06-10T16:30:02.175Z","modTS":"2021-11-18T07:03:29.356Z","__v":0},{"_id":"5ede59780b1f934f45df242a","location":"Dribble Arena Test,Indiranagar","hostId":"2537e208-35f2-4b38-ac65-081ab1a249be","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"dcc3a75f-2841-4317-b4c2-88159285027f","sportId":"SP5","date":"2020-06-08T00:00:00.000Z","startTime":"2020-06-08T11:30:00.000Z","endTime":"2020-06-08T12:30:00.000Z","timing":2,"pals":[{"noshow":false,"noshowSwitch":false,"rating":5,"newPlaypal":false,"isRemoved":true,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2020-06-09T03:53:07.000Z","userName":"playo user"},{"noshow":false,"noshowSwitch":false,"rating":0,"newPlaypal":false,"isRemoved":false,"palId":"861c3457-c99c-4dbb-ab2c-5eb447eaf9fe","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2020-06-08T15:30:00.261Z"}],"createdTS":"2020-06-08T15:30:00.262Z","modTS":"2021-11-18T07:03:29.356Z","__v":0},{"_id":"5edbdf7cf164da32c113b35b","location":"Game Theory - 100 feet road - Indiranagar, 100 Feet Road","hostId":"a458fa2e-37e8-4e9d-beb1-3b4e68e5d56e","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"ee87f1fb-31b0-4640-b718-5b2557c9104f","sportId":"SP5","date":"2020-06-06T00:00:00.000Z","timing":3,"pals":[{"noshow":false,"noshowSwitch":false,"rating":4,"newPlaypal":true,"isRemoved":false,"palId":"a458fa2e-37e8-4e9d-beb1-3b4e68e5d56e","reputation":[{"reputationId":0,"value":1},{"reputationId":1,"value":1},{"reputationId":2,"value":1}],"timestamp":"2020-06-08T17:01:37.000Z"}],"createdTS":"2020-06-06T18:25:00.148Z","modTS":"2020-06-08T18:25:00.227Z","__v":0},{"_id":"5edbdf7df164da32c113b362","location":"BTM Layout","hostId":"2537e208-35f2-4b38-ac65-081ab1a249be","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"e70f154d-6663-401f-922b-a98f737cf0e4","sportId":"SP5","date":"2020-06-06T00:00:00.000Z","timing":3,"pals":[{"noshow":true,"noshowSwitch":false,"rating":4,"newPlaypal":false,"isRemoved":true,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2020-06-09T03:54:28.000Z","firstRatedOn":"2020-06-09T03:54:28.000Z","userName":"playo user"}],"createdTS":"2020-06-06T18:25:01.155Z","modTS":"2021-11-18T07:03:29.356Z","__v":0},{"_id":"5ed5d5c8ec9f4b7276ef8d7e","location":"Dribble Arena Test,Indiranagar","hostId":"d1ba3771-0255-41bf-9889-e222c97e986b","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"f2c4ce11-bde0-45f7-aae9-a470ded10530","sportId":"SP5","date":"2020-06-02T00:00:00.000Z","startTime":"2020-06-02T03:30:00.000Z","endTime":"2020-06-02T04:30:00.000Z","timing":1,"pals":[{"noshow":false,"noshowSwitch":false,"rating":3,"newPlaypal":false,"isRemoved":true,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2020-06-02T08:22:16.000Z","userName":"playo user"}],"createdTS":"2020-06-02T04:30:00.768Z","modTS":"2021-11-18T07:03:29.356Z","__v":0},{"_id":"5ed51ef8749cca727da39f6b","location":"Mekur Hosakeri","hostId":"2537e208-35f2-4b38-ac65-081ab1a249be","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"b76c1f0b-ed02-46c3-847e-c2ed0230f44b","sportId":"SP5","date":"2020-06-01T00:00:00.000Z","timing":2,"pals":[{"noshow":true,"noshowSwitch":false,"rating":5,"newPlaypal":false,"firstRatedOn":"2020-06-04T11:16:18.000Z","isRemoved":true,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":1},{"reputationId":1,"value":1},{"reputationId":2,"value":-1}],"timestamp":"2020-06-04T11:16:23.000Z","userName":"playo user"}],"createdTS":"2020-06-01T15:30:00.186Z","modTS":"2021-11-18T07:03:29.356Z","__v":0},{"_id":"5ed4cafb417f305b48c80d58","location":"Magrath Road, Shanthala Nagar","hostId":"2537e208-35f2-4b38-ac65-081ab1a249be","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":true,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"efb5ee60-ab12-41f4-babf-099b50b2d7ea","sportId":"SP5","date":"2020-05-30T00:00:00.000Z","timing":2,"pals":[{"noshow":false,"noshowSwitch":false,"rating":5,"newPlaypal":true,"isRemoved":false,"palId":"861c3457-c99c-4dbb-ab2c-5eb447eaf9fe","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2020-06-05T20:38:34.000Z","firstRatedOn":"2020-06-05T20:38:12.000Z"},{"noshow":false,"noshowSwitch":false,"rating":0,"newPlaypal":false,"isRemoved":true,"palId":"d1ba3771-0255-41bf-9889-e222c97e986b","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2020-06-01T09:31:39.326Z","userName":"playo user"},{"noshow":false,"noshowSwitch":false,"rating":2,"newPlaypal":true,"isRemoved":true,"palId":"54fe8420-dae7-4bb2-aa08-320b7dc40794","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2020-06-10T09:41:20.000Z","firstRatedOn":"2020-06-10T09:41:20.000Z","userName":"playo user"},{"noshow":false,"noshowSwitch":false,"rating":0,"newPlaypal":true,"isRemoved":false,"palId":"2d617f4d-7be2-4fe7-be3a-7c09fd7e513c","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2020-06-01T09:31:39.325Z"}],"createdTS":"2020-06-01T09:31:39.326Z","modTS":"2021-11-18T07:09:26.826Z","__v":0},{"_id":"619b94008fff1950a20adaf2","location":"Indiranagar","hostId":"1b7887d3-8255-409b-9efe-89b64b701862","matchHappened":true,"matchRating":-1,"userPlayed":true,"expired":false,"cancelled":false,"noshow":false,"removed":false,"userId":"2537e208-35f2-4b38-ac65-081ab1a249be","activityId":"afabf002-5260-4248-b200-cedbcbe3fc59","sportId":"SP5","date":"2021-11-22T00:00:00.000Z","startTime":"2021-11-22T13:30:00.794Z","endTime":"2021-11-22T14:00:00.794Z","timing":2,"pals":[{"noshow":true,"noshowSwitch":false,"rating":0,"newPlaypal":false,"firstRatedOn":null,"isRemoved":false,"userPresent":null,"palId":"1b7887d3-8255-409b-9efe-89b64b701862","reputation":[{"reputationId":0,"value":1},{"reputationId":1,"value":1},{"reputationId":2,"value":1}],"timestamp":"2021-11-22T12:58:40.047Z"},{"noshow":true,"noshowSwitch":false,"rating":0,"newPlaypal":false,"firstRatedOn":null,"isRemoved":false,"userPresent":null,"palId":"a458fa2e-37e8-4e9d-beb1-3b4e68e5d56e","reputation":[{"reputationId":0,"value":-1},{"reputationId":1,"value":-1},{"reputationId":2,"value":-1}],"timestamp":"2021-11-22T12:58:40.047Z"}],"createdTS":"2021-11-22T12:58:40.047Z","modTS":"2021-11-22T13:00:41.806Z","__v":0}];
|
|
215
3
|
|
|
4
|
+
const ratingTest = require("./lib/ratings/index");
|
|
216
5
|
|
|
217
|
-
|
|
6
|
+
const test = ratingTest.getUserRecentRatings(data, 4);
|
|
218
7
|
|
|
219
|
-
|
|
8
|
+
console.log(test, data.length);
|