@universis/accommodation 1.1.3 → 1.1.5
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/dist/config/models/AccommodationRoom.json +0 -5
- package/dist/config/models/RoomType.json +246 -240
- package/dist/config/models/StudentAccommodationCard.json +1 -4
- package/dist/config/scope.access.js +9 -0
- package/dist/config/scope.access.js.map +1 -1
- package/dist/listeners/StudentAccommodationCardSaveListener.js +13 -2
- package/dist/listeners/StudentAccommodationCardSaveListener.js.map +1 -1
- package/dist/models/StudentAccommodationCard.js +170 -47
- package/dist/models/StudentAccommodationCard.js.map +1 -1
- package/package.json +1 -1
- package/src/config/models/AccommodationRoom.json +0 -5
- package/src/config/models/RoomType.json +246 -240
- package/src/config/models/StudentAccommodationCard.json +1 -4
- package/src/config/scope.access.js +9 -0
- package/src/listeners/StudentAccommodationCardSaveListener.js +14 -3
- package/src/models/StudentAccommodationCard.js +157 -34
- package/dist/listeners/OnUpdateAccommodationRoomListener.js +0 -151
- package/dist/listeners/OnUpdateAccommodationRoomListener.js.map +0 -1
- package/src/listeners/OnUpdateAccommodationRoomListener.js +0 -150
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"$schema": "https://themost-framework.github.io/themost/models/2018/2/schema.json",
|
|
3
3
|
"@id": "https://universis.io/schemas/RoomType",
|
|
4
4
|
"name": "RoomType",
|
|
5
|
-
"title": "Τύπος
|
|
5
|
+
"title": "Τύπος δωματίου",
|
|
6
6
|
"type": "lookup",
|
|
7
7
|
"hidden": false,
|
|
8
8
|
"sealed": false,
|
|
9
|
-
"version": "1.4",
|
|
9
|
+
"version": "1.4.1",
|
|
10
10
|
"fields": [
|
|
11
11
|
{
|
|
12
12
|
"name": "id",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"nullable": false,
|
|
28
28
|
"size": 100
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
{
|
|
31
31
|
"name": "alternateName",
|
|
32
32
|
"title": "Εναλλακτική Ονομασία",
|
|
33
33
|
"description": "Εναλλακτική Ονομασία",
|
|
@@ -44,6 +44,12 @@
|
|
|
44
44
|
"nullable": false,
|
|
45
45
|
"value": "javascript:return 0;"
|
|
46
46
|
},
|
|
47
|
+
{
|
|
48
|
+
"name": "bedsAllowed",
|
|
49
|
+
"type": "number",
|
|
50
|
+
"value": "javascript:return 0;",
|
|
51
|
+
"description": "The total allowed number of beds for the room type"
|
|
52
|
+
},
|
|
47
53
|
{
|
|
48
54
|
"name": "locales",
|
|
49
55
|
"type": "RoomTypeLocale",
|
|
@@ -79,247 +85,247 @@
|
|
|
79
85
|
}
|
|
80
86
|
],
|
|
81
87
|
"privileges": [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
88
|
+
{
|
|
89
|
+
"mask": 1,
|
|
90
|
+
"type": "global",
|
|
91
|
+
"account": "*"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"mask": 31,
|
|
95
|
+
"type": "global"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"mask": 15,
|
|
99
|
+
"type": "global",
|
|
100
|
+
"account": "Administrators"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"mask": 15,
|
|
104
|
+
"type": "global",
|
|
105
|
+
"account": "AccommodationAdministrators"
|
|
106
|
+
}
|
|
101
107
|
],
|
|
102
108
|
"eventListeners": [
|
|
103
109
|
{
|
|
104
110
|
"type": "./listeners/data-localization"
|
|
105
111
|
}
|
|
106
112
|
],
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
]
|
|
113
|
+
"seed": [
|
|
114
|
+
{
|
|
115
|
+
"alternateName": "unknown",
|
|
116
|
+
"name": "Άγνωστο",
|
|
117
|
+
"description": "Άγνωστο",
|
|
118
|
+
"locales": [
|
|
119
|
+
{
|
|
120
|
+
"inLanguage": "en",
|
|
121
|
+
"name": "Unknown",
|
|
122
|
+
"description": "Unknown"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"alternateName": "restaurant",
|
|
128
|
+
"name": "Εστιατόριο",
|
|
129
|
+
"description": "Εστιατόριο",
|
|
130
|
+
"locales": [
|
|
131
|
+
{
|
|
132
|
+
"inLanguage": "en",
|
|
133
|
+
"name": "Restaurant",
|
|
134
|
+
"description": "Restaurant"
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"alternateName": "plain",
|
|
140
|
+
"name": "Κανονικό",
|
|
141
|
+
"description": "Κανονικό",
|
|
142
|
+
"locales": [
|
|
143
|
+
{
|
|
144
|
+
"inLanguage": "en",
|
|
145
|
+
"name": "Plain",
|
|
146
|
+
"description": "Plain"
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"alternateName": "disabled",
|
|
152
|
+
"name": "Ανενεργό",
|
|
153
|
+
"description": "Ανενεργό",
|
|
154
|
+
"locales": [
|
|
155
|
+
{
|
|
156
|
+
"inLanguage": "en",
|
|
157
|
+
"name": "Disabled",
|
|
158
|
+
"description": "Disabled"
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"alternateName": "warehouse",
|
|
164
|
+
"name": "Αποθήκη",
|
|
165
|
+
"description": "Αποθήκη",
|
|
166
|
+
"locales": [
|
|
167
|
+
{
|
|
168
|
+
"inLanguage": "en",
|
|
169
|
+
"name": "Warehouse",
|
|
170
|
+
"description": "Warehouse"
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"alternateName": "office",
|
|
176
|
+
"name": "Γραφείο",
|
|
177
|
+
"description": "Γραφείο",
|
|
178
|
+
"locales": [
|
|
179
|
+
{
|
|
180
|
+
"inLanguage": "en",
|
|
181
|
+
"name": "Office",
|
|
182
|
+
"description": "Office"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"alternateName": "lab",
|
|
188
|
+
"name": "Εργαστήριο",
|
|
189
|
+
"description": "Εργαστήριο",
|
|
190
|
+
"locales": [
|
|
191
|
+
{
|
|
192
|
+
"inLanguage": "en",
|
|
193
|
+
"name": "Lab",
|
|
194
|
+
"description": "Lab"
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"alternateName": "wc",
|
|
200
|
+
"name": "WC",
|
|
201
|
+
"description": "WC",
|
|
202
|
+
"locales": [
|
|
203
|
+
{
|
|
204
|
+
"inLanguage": "en",
|
|
205
|
+
"name": "WC",
|
|
206
|
+
"description": "WC"
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"alternateName": "reading-room",
|
|
212
|
+
"name": "Αναγνωστήριο",
|
|
213
|
+
"description": "Αναγνωστήριο",
|
|
214
|
+
"locales": [
|
|
215
|
+
{
|
|
216
|
+
"inLanguage": "en",
|
|
217
|
+
"name": "Reading Room",
|
|
218
|
+
"description": "Reading Room"
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"alternateName": "multi-purpose",
|
|
224
|
+
"name": "Πολυχρηστικό",
|
|
225
|
+
"description": "Πολυχρηστικό",
|
|
226
|
+
"locales": [
|
|
227
|
+
{
|
|
228
|
+
"inLanguage": "en",
|
|
229
|
+
"name": "Multi purpose",
|
|
230
|
+
"description": "Multi purpose"
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"alternateName": "event-hall",
|
|
236
|
+
"name": "Αίθουσα εκδηλώσεων",
|
|
237
|
+
"description": "Αίθουσα εκδηλώσεων",
|
|
238
|
+
"locales": [
|
|
239
|
+
{
|
|
240
|
+
"inLanguage": "en",
|
|
241
|
+
"name": "Event hall",
|
|
242
|
+
"description": "Event hall"
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"alternateName": "library",
|
|
248
|
+
"name": "Βιβλιοθήκη",
|
|
249
|
+
"description": "Βιβλιοθήκη",
|
|
250
|
+
"locales": [
|
|
251
|
+
{
|
|
252
|
+
"inLanguage": "en",
|
|
253
|
+
"name": "Library",
|
|
254
|
+
"description": "Library"
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"alternateName": "boiler",
|
|
260
|
+
"name": "Λεβητοστάσιο",
|
|
261
|
+
"description": "Λεβητοστάσιο",
|
|
262
|
+
"locales": [
|
|
263
|
+
{
|
|
264
|
+
"inLanguage": "en",
|
|
265
|
+
"name": "Boiler",
|
|
266
|
+
"description": "Boiler"
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"alternateName": "mechanical",
|
|
272
|
+
"name": "Μηχανοστάσιο",
|
|
273
|
+
"description": "Μηχανοστάσιο",
|
|
274
|
+
"locales": [
|
|
275
|
+
{
|
|
276
|
+
"inLanguage": "en",
|
|
277
|
+
"name": "Mechanical",
|
|
278
|
+
"description": "Mechanical"
|
|
279
|
+
}
|
|
280
|
+
]
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"alternateName": "laundry",
|
|
284
|
+
"name": "Πλυντήριο",
|
|
285
|
+
"description": "Πλυντήριο",
|
|
286
|
+
"locales": [
|
|
287
|
+
{
|
|
288
|
+
"inLanguage": "en",
|
|
289
|
+
"name": "Laundry",
|
|
290
|
+
"description": "Laundry"
|
|
291
|
+
}
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"alternateName": "church",
|
|
296
|
+
"name": "Εκκλησία",
|
|
297
|
+
"description": "Εκκλησία",
|
|
298
|
+
"locales": [
|
|
299
|
+
{
|
|
300
|
+
"inLanguage": "en",
|
|
301
|
+
"name": "Church",
|
|
302
|
+
"description": "Church"
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"alternateName": "hostel",
|
|
308
|
+
"name": "Χόστελ",
|
|
309
|
+
"description": "Χόστελ",
|
|
310
|
+
"locales": [
|
|
311
|
+
{
|
|
312
|
+
"inLanguage": "en",
|
|
313
|
+
"name": "Hostel",
|
|
314
|
+
"description": "Hostel"
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"alternateName": "temporary",
|
|
320
|
+
"name": "Προσωρινό",
|
|
321
|
+
"description": "Προσωρινό",
|
|
322
|
+
"locales": [
|
|
323
|
+
{
|
|
324
|
+
"inLanguage": "en",
|
|
325
|
+
"name": "Temporary",
|
|
326
|
+
"description": "Temporary"
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
]
|
|
325
331
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"title": "StudentAccommodationCard",
|
|
6
6
|
"hidden": false,
|
|
7
7
|
"sealed": false,
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.9",
|
|
9
9
|
"source": "StudentAccommodationCardBase",
|
|
10
10
|
"view": "StudentAccommodationCardData",
|
|
11
11
|
"classPath": "./models/StudentAccommodationCard",
|
|
@@ -150,9 +150,6 @@
|
|
|
150
150
|
{
|
|
151
151
|
"type": "./listeners/OnCancelAccommodationCardListener"
|
|
152
152
|
},
|
|
153
|
-
{
|
|
154
|
-
"type": "./listeners/OnUpdateAccommodationRoomListener"
|
|
155
|
-
},
|
|
156
153
|
{
|
|
157
154
|
"type": "./listeners/SendEmailAfterCardStatusChangeListener"
|
|
158
155
|
}
|
|
@@ -22,15 +22,26 @@ export function beforeSave(event, callback) {
|
|
|
22
22
|
throw new DataError('ERR_STATUS','Student cannot be found');
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
// const isActive = await student.silent().isActive();
|
|
26
25
|
const isActive = await student.is(':active');
|
|
27
|
-
|
|
26
|
+
|
|
27
|
+
if (!isActive && event.state===1)
|
|
28
|
+
{
|
|
28
29
|
throw new DataError('ERR_STATUS',
|
|
29
30
|
'Invalid student status. Student Accommodation Card may be published upon an active student only.'+student
|
|
30
31
|
, null,
|
|
31
32
|
'Student', 'studentStatus');
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
+
if (Object.prototype.hasOwnProperty.call(event.target, 'CardStatus')) {
|
|
35
|
+
const previousActionStatus = await context.model('ActionStatusType').find(previous.cardStatus).select('alternateName').value();
|
|
36
|
+
const targetActionStatus = await context.model('ActionStatusType').find(event.target.cardStatus).select('alternateName').value();
|
|
37
|
+
if (!isActive && previousActionStatus !== targetActionStatus && targetActionStatus!=='CancelledActionStatus') {
|
|
38
|
+
throw new DataError('ERR_STATUS',
|
|
39
|
+
'The student accommodation card cannot be activated for an inactive student' + student
|
|
40
|
+
, null,
|
|
41
|
+
'Student', 'studentStatus');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
34
45
|
const academicYear = context.model('AcademicYear').convert(event.target.academicYear).getId();
|
|
35
46
|
if (Number.isInteger(academicYear) === false) {
|
|
36
47
|
throw new DataError('E_VALUE', 'Invalid academic year. Expected number.', null, 'AcademicYear', 'id');
|