@universis/accommodation 1.0.0 → 1.1.0
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/Accommodation.json +42 -2
- package/dist/config/models/AccommodationLocale.json +86 -0
- package/dist/config/models/AccommodationRoom.json +41 -2
- package/dist/config/models/AccommodationRoomLocale.json +86 -0
- package/dist/listeners/ValidateActionListener.js +4 -4
- package/dist/listeners/ValidateActionListener.js.map +1 -1
- package/dist/locales/el.json +3 -0
- package/dist/locales/en.json +3 -0
- package/package.json +1 -1
- package/src/config/models/Accommodation.json +42 -2
- package/src/config/models/AccommodationLocale.json +86 -0
- package/src/config/models/AccommodationRoom.json +41 -2
- package/src/config/models/AccommodationRoomLocale.json +86 -0
- package/src/listeners/ValidateActionListener.js +4 -4
- package/src/locales/el.json +3 -0
- package/src/locales/en.json +3 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"sealed": false,
|
|
9
9
|
"implements": "Place",
|
|
10
10
|
"classPath": "./models/Accommodation",
|
|
11
|
-
"version": "1.
|
|
11
|
+
"version": "1.6",
|
|
12
12
|
"fields": [
|
|
13
13
|
{
|
|
14
14
|
"@id": "http://schema.org/identifier",
|
|
@@ -66,9 +66,49 @@
|
|
|
66
66
|
"description": "The geo coordinates of the accommodation.",
|
|
67
67
|
"type": "Json",
|
|
68
68
|
"additionalType": "GeoCoordinates"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "locales",
|
|
72
|
+
"type": "AccommodationLocale",
|
|
73
|
+
"mapping": {
|
|
74
|
+
"associationType": "association",
|
|
75
|
+
"cascade": "delete",
|
|
76
|
+
"parentModel": "Accommodation",
|
|
77
|
+
"parentField": "id",
|
|
78
|
+
"childModel": "AccommodationLocale",
|
|
79
|
+
"childField": "object"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "locale",
|
|
84
|
+
"type": "AccommodationLocale",
|
|
85
|
+
"readonly": true,
|
|
86
|
+
"editable": false,
|
|
87
|
+
"many": true,
|
|
88
|
+
"expandable": true,
|
|
89
|
+
"multiplicity": "ZeroOrOne",
|
|
90
|
+
"mapping": {
|
|
91
|
+
"associationType": "association",
|
|
92
|
+
"cascade": "delete",
|
|
93
|
+
"parentModel": "Accommodation",
|
|
94
|
+
"parentField": "id",
|
|
95
|
+
"childModel": "AccommodationLocale",
|
|
96
|
+
"childField": "object",
|
|
97
|
+
"options": {
|
|
98
|
+
"$filter": "inLanguage eq lang()",
|
|
99
|
+
"$first": true
|
|
100
|
+
}
|
|
101
|
+
}
|
|
69
102
|
}
|
|
70
103
|
],
|
|
71
|
-
"eventListeners": [
|
|
104
|
+
"eventListeners": [
|
|
105
|
+
{
|
|
106
|
+
"type": "@themost/data/previous-state-listener"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"type": "./listeners/data-localization"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
72
112
|
"constraints": [
|
|
73
113
|
{
|
|
74
114
|
"type": "unique",
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://themost-framework.github.io/themost/models/2018/2/schema.json",
|
|
3
|
+
"@id": "https://universis.io/entities/AccommodationLocale",
|
|
4
|
+
"name": "AccommodationLocale",
|
|
5
|
+
"description": "Contains a collection of extra field required for accommodation.",
|
|
6
|
+
"title": "AccommodationLocale",
|
|
7
|
+
"abstract": false,
|
|
8
|
+
"contains": "Accommodation",
|
|
9
|
+
"hidden": true,
|
|
10
|
+
"sealed": false,
|
|
11
|
+
"version": "1.0",
|
|
12
|
+
"fields": [
|
|
13
|
+
{
|
|
14
|
+
"@id": "https://themost.io/schemas/id",
|
|
15
|
+
"name": "id",
|
|
16
|
+
"title": "ID",
|
|
17
|
+
"description": "The identifier of the item.",
|
|
18
|
+
"type": "Counter",
|
|
19
|
+
"primary": true,
|
|
20
|
+
"nullable": false
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"@id": "https://themost.io/schemas/object",
|
|
24
|
+
"name": "object",
|
|
25
|
+
"title": "object",
|
|
26
|
+
"description": "The parent item.",
|
|
27
|
+
"type": "Accommodation"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"@id": "http://schema.org/inLanguage",
|
|
31
|
+
"name": "inLanguage",
|
|
32
|
+
"title": "inLanguage",
|
|
33
|
+
"description": "The language of this item.",
|
|
34
|
+
"type": "Text",
|
|
35
|
+
"size": 5
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "name",
|
|
39
|
+
"title": "Ονομασία",
|
|
40
|
+
"description": "Η ονομασία του αντικειμένου",
|
|
41
|
+
"type": "Text",
|
|
42
|
+
"nullable": true,
|
|
43
|
+
"size": 100
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "description",
|
|
47
|
+
"title": "Περιγραφή",
|
|
48
|
+
"description": "Περιγραφή του τύπου εργασίας",
|
|
49
|
+
"type": "Text",
|
|
50
|
+
"nullable": true,
|
|
51
|
+
"size": 80
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "displayCode",
|
|
55
|
+
"title": "Display code",
|
|
56
|
+
"description": "The display code of the place",
|
|
57
|
+
"type": "Text",
|
|
58
|
+
"size": 15
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"constraints": [
|
|
62
|
+
{
|
|
63
|
+
"type": "unique",
|
|
64
|
+
"fields": [
|
|
65
|
+
"object",
|
|
66
|
+
"inLanguage"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"privileges": [
|
|
71
|
+
{
|
|
72
|
+
"mask": 1,
|
|
73
|
+
"type": "global",
|
|
74
|
+
"account": "*"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"mask": 15,
|
|
78
|
+
"type": "global"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"mask": 15,
|
|
82
|
+
"type": "global",
|
|
83
|
+
"account": "Administrators"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"abstract": false,
|
|
8
8
|
"sealed": false,
|
|
9
9
|
"implements": "Accommodation",
|
|
10
|
-
"version": "
|
|
10
|
+
"version": "2.0.1",
|
|
11
11
|
"fields": [
|
|
12
12
|
{
|
|
13
13
|
"name": "bed",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"size": 500
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
"name": "
|
|
18
|
+
"name": "floor",
|
|
19
19
|
"type": "Text",
|
|
20
20
|
"size": 500
|
|
21
21
|
},
|
|
@@ -128,9 +128,48 @@
|
|
|
128
128
|
"name": "reasonOutOfService",
|
|
129
129
|
"type": "Text",
|
|
130
130
|
"size": 500
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "locales",
|
|
134
|
+
"type": "AccommodationRoomLocale",
|
|
135
|
+
"mapping": {
|
|
136
|
+
"associationType": "association",
|
|
137
|
+
"cascade": "delete",
|
|
138
|
+
"parentModel": "AccommodationRoom",
|
|
139
|
+
"parentField": "id",
|
|
140
|
+
"childModel": "AccommodationRoomLocale",
|
|
141
|
+
"childField": "object"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "locale",
|
|
146
|
+
"type": "AccommodationRoomLocale",
|
|
147
|
+
"readonly": true,
|
|
148
|
+
"editable": false,
|
|
149
|
+
"many": true,
|
|
150
|
+
"expandable": true,
|
|
151
|
+
"multiplicity": "ZeroOrOne",
|
|
152
|
+
"mapping": {
|
|
153
|
+
"associationType": "association",
|
|
154
|
+
"cascade": "delete",
|
|
155
|
+
"parentModel": "AccommodationRoom",
|
|
156
|
+
"parentField": "id",
|
|
157
|
+
"childModel": "AccommodationRoomLocale",
|
|
158
|
+
"childField": "object",
|
|
159
|
+
"options": {
|
|
160
|
+
"$filter": "inLanguage eq lang()",
|
|
161
|
+
"$first": true
|
|
162
|
+
}
|
|
163
|
+
}
|
|
131
164
|
}
|
|
132
165
|
],
|
|
133
166
|
"eventListeners": [
|
|
167
|
+
{
|
|
168
|
+
"type": "@themost/data/previous-state-listener"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"type": "./listeners/data-localization"
|
|
172
|
+
}
|
|
134
173
|
],
|
|
135
174
|
"privileges": [
|
|
136
175
|
{
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://themost-framework.github.io/themost/models/2018/2/schema.json",
|
|
3
|
+
"@id": "https://universis.io/entities/AccommodationRoomLocale",
|
|
4
|
+
"name": "AccommodationRoomLocale",
|
|
5
|
+
"description": "Contains a collection of extra field required for accommodation room.",
|
|
6
|
+
"title": "AccommodationRoomLocale",
|
|
7
|
+
"abstract": false,
|
|
8
|
+
"contains": "AccommodationRoom",
|
|
9
|
+
"hidden": true,
|
|
10
|
+
"sealed": false,
|
|
11
|
+
"version": "1.0",
|
|
12
|
+
"fields": [
|
|
13
|
+
{
|
|
14
|
+
"@id": "https://themost.io/schemas/id",
|
|
15
|
+
"name": "id",
|
|
16
|
+
"title": "ID",
|
|
17
|
+
"description": "The identifier of the item.",
|
|
18
|
+
"type": "Counter",
|
|
19
|
+
"primary": true,
|
|
20
|
+
"nullable": false
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"@id": "https://themost.io/schemas/object",
|
|
24
|
+
"name": "object",
|
|
25
|
+
"title": "object",
|
|
26
|
+
"description": "The parent item.",
|
|
27
|
+
"type": "AccommodationRoom"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"@id": "http://schema.org/inLanguage",
|
|
31
|
+
"name": "inLanguage",
|
|
32
|
+
"title": "inLanguage",
|
|
33
|
+
"description": "The language of this item.",
|
|
34
|
+
"type": "Text",
|
|
35
|
+
"size": 5
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "name",
|
|
39
|
+
"title": "Ονομασία",
|
|
40
|
+
"description": "Η ονομασία του αντικειμένου",
|
|
41
|
+
"type": "Text",
|
|
42
|
+
"nullable": true,
|
|
43
|
+
"size": 100
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "description",
|
|
47
|
+
"title": "Περιγραφή",
|
|
48
|
+
"description": "Περιγραφή του τύπου εργασίας",
|
|
49
|
+
"type": "Text",
|
|
50
|
+
"nullable": true,
|
|
51
|
+
"size": 80
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "displayCode",
|
|
55
|
+
"title": "Display code",
|
|
56
|
+
"description": "The display code of the place",
|
|
57
|
+
"type": "Text",
|
|
58
|
+
"size": 15
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"constraints": [
|
|
62
|
+
{
|
|
63
|
+
"type": "unique",
|
|
64
|
+
"fields": [
|
|
65
|
+
"object",
|
|
66
|
+
"inLanguage"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"privileges": [
|
|
71
|
+
{
|
|
72
|
+
"mask": 1,
|
|
73
|
+
"type": "global",
|
|
74
|
+
"account": "*"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"mask": 15,
|
|
78
|
+
"type": "global"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"mask": 15,
|
|
82
|
+
"type": "global",
|
|
83
|
+
"account": "Administrators"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
@@ -49,10 +49,10 @@ async function beforeSaveAsync(event) {
|
|
|
49
49
|
//check studentConsent
|
|
50
50
|
if (event.target && eventHasConsent === true && Object.prototype.hasOwnProperty.call(target, 'studentConsent') === false) {
|
|
51
51
|
const translateService = context.application.getStrategy(function TranslateService() {});
|
|
52
|
-
throw new _common.DataError('E_STUDENT_CONSENT', translateService.translate('The
|
|
52
|
+
throw new _common.DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');
|
|
53
53
|
} else if (event.target && eventHasConsent === true && Object.prototype.hasOwnProperty.call(target, 'studentConsent') === true && target.studentConsent === false) {
|
|
54
54
|
const translateService = context.application.getStrategy(function TranslateService() {});
|
|
55
|
-
throw new _common.DataError('E_STUDENT_CONSENT', translateService.translate('The
|
|
55
|
+
throw new _common.DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');
|
|
56
56
|
}
|
|
57
57
|
//check category
|
|
58
58
|
if (target && Object.prototype.hasOwnProperty.call(target, 'category') && target.category == null) {
|
|
@@ -96,10 +96,10 @@ async function beforeSaveAsync(event) {
|
|
|
96
96
|
if (isMe === true && eventHasConsent === true) {
|
|
97
97
|
if (Object.prototype.hasOwnProperty.call(target, 'studentConsent') === false) {
|
|
98
98
|
const translateService = context.application.getStrategy(function TranslateService() {});
|
|
99
|
-
throw new _common.DataError('E_STUDENT_CONSENT', translateService.translate('The
|
|
99
|
+
throw new _common.DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');
|
|
100
100
|
} else if (eventHasConsent === true && target.studentConsent === false) {
|
|
101
101
|
const translateService = context.application.getStrategy(function TranslateService() {});
|
|
102
|
-
throw new _common.DataError('E_STUDENT_CONSENT', translateService.translate('The
|
|
102
|
+
throw new _common.DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidateActionListener.js","names":["_common","require","_errors","_data","beforeSaveAsync","event","runAllRules","user","model","context","target","convert","studentId","student","action","eventHasConsent","Object","prototype","hasOwnProperty","call","actionID","id","where","equal","select","getItem","DataError","isMe","is","isActive","HttpForbiddenError","accommodationRequestEvent","silent","value","state","translateService","application","getStrategy","TranslateService","translate","studentConsent","category","__","actionStatus","removeAllInformationExceptStatus","alternateName","previous","agent","militaryActive","applyRulesForPrerequisites","militarySchool","studentHouseResident","sameDegreeHolder","foreignScholarStudent","foreignStudentOrChildOfGreekExpatriate","applyRulesForCyprusStudentOrForeignStudentOrChildOfGreekExpatriate","studentReceivesUnemploymentBenefit","institutionOrClubLocationSameAsStudentPermanentResidence","studentSubmitsTaxReportInGreece","nullifyFamilyInformation","nullifyGuardianFinancialInformation","nullifySpouseFinancialInformation","nullifyStudentFinancialInformation","maritalStatus","noOfChildren","guardianType","institutionOrClubLocationSameAsGuardianPermanentResidence","guardianNoOfChildren","numberOfStudyingSiblings","nullifyPersonalInformation","studentAfm","studentDisabledPerson","studentOrphan","institutionOrClubLocationSameAsGuadianPermanentResidence","studentGuardianTotalIncome","studentGuardianAfm","studentGuardianReceivesUnemploymentBenefit","studentGuardianSubmitsTaxReportInGreece","studentSpouseTotalIncome","studentSpouseAfm","studentSpouseReceivesUnemploymentBenefit","studentTotalIncome","lessThan25yrs","allInformationSubmittedIsTrueConfirmation","afterSaveAsync","beforeRemoveAsync","afterRemoveAsync","beforeSave","callback","then","catch","err","afterSave","afterRemove","beforeRemove"],"sources":["../../src/listeners/ValidateActionListener.js"],"sourcesContent":["import {DataError} from \"@themost/common\";\nimport { HttpForbiddenError } from '@themost/common/errors';\nimport { DataObjectState, DataModel } from \"@themost/data\";\n// eslint-disable-next-line no-unused-vars\nasync function beforeSaveAsync(event) {\n\n let runAllRules = false;\n const user = event.model.context.user;\n const target = event.model.convert(event.target);\n const context = event.model.context;\n\n let studentId = target.student;\n let action;\n let eventHasConsent;\n\n if (!Object.prototype.hasOwnProperty.call(target,'student')) {\n const actionID = event.target || event.target.id;\n action = await context.model('AccommodationRequestAction')\n .where('id')\n .equal(actionID)\n .select('student','accommodationRequestEvent/hasConsent as hasConsent','studentConsent')\n .getItem();\n studentId = action.student;\n }\n if (!studentId) {\n throw new DataError('E_STUDENT', 'The student cannot be empty at this context.');\n }\n\n const student = event.model.context.model('Student').convert(studentId);\n \n const isMe = await student.is(':me');\n if (isMe) {\n const isActive = await student.is(':active');\n if (!isActive) {\n throw new HttpForbiddenError();\n }\n\n const accommodationRequestEvent = target.accommodationRequestEvent || target.accommodationRequestEvent.id;\n eventHasConsent = await context.model('AccommodationRequestEvent')\n .where('id')\n .equal(accommodationRequestEvent)\n .select('hasConsent')\n .silent()\n .value();\n }\n\n if (event.state === 2) {\n if (isMe === true) {\n //check studentConsent\n if (event.target && eventHasConsent === true && Object.prototype.hasOwnProperty.call(target, 'studentConsent') === false) {\n const translateService = context.application.getStrategy(function TranslateService() { });\n throw new DataError('E_STUDENT_CONSENT', translateService.translate('The application cannot be saved without consent about personal data.'), null, 'AccommodationRequestAction', 'studentConsent');\n } else if (event.target && eventHasConsent === true && Object.prototype.hasOwnProperty.call(target, 'studentConsent') === true && target.studentConsent === false) {\n const translateService = context.application.getStrategy(function TranslateService() { });\n throw new DataError('E_STUDENT_CONSENT', translateService.translate('The application cannot be saved without consent about personal data.'), null, 'AccommodationRequestAction', 'studentConsent');\n }\n //check category\n if (target && (Object.prototype.hasOwnProperty.call(target, 'category') && (target.category == null))) {\n throw new HttpForbiddenError(\n context.__(\n 'The accommodation request creation failed because no request category has been set.'\n )\n );\n }\n\n }\n\n //UPDATE\n //Load current status\n const actionStatus = await event.model.where('id').equal(event.target.id).select('actionStatus/alternateName').value();\n \n //Action is not submitted yet. Run again all rules\n if (actionStatus === 'PotentialActionStatus') {\n runAllRules = true;\n }\n else if (actionStatus === 'ActiveActionStatus' || actionStatus === 'CompletedActionStatus'){\n //accommodation request already submitted. Do not allow to update any property \n removeAllInformationExceptStatus(event.target);\n }\n else if (actionStatus === 'CancelledActionStatus' && event.target.actionStatus && event.target.actionStatus.alternateName !== actionStatus && event.target.actionStatus.alternateName != 'ActiveActionStatus') {\n //accommodation request already cancelled. \n throw new DataError('E_VALUE', 'Cannot update cancelled action.', null, 'AccommodationRequestAction', 'actionStatus');\n }\n // allow agent to change request's status when target request status = 'ActiveActionStatus' example: to reconsider a cancelled request\n else if (actionStatus === 'CancelledActionStatus' && event.target.actionStatus && event.target.actionStatus.alternateName !== actionStatus && event.target.actionStatus.alternateName === 'ActiveActionStatus') {\n let model = event.target;\n // set loggedIn user as request's agent\n if (event.previous.agent != user.id) {\n model.agent = user.id;\n }\n }\n }\n\n else if (event.state === 1) {\n // check studentConsent\n if (isMe === true && eventHasConsent === true) {\n if (Object.prototype.hasOwnProperty.call(target, 'studentConsent') === false) {\n const translateService = context.application.getStrategy(function TranslateService() { });\n throw new DataError('E_STUDENT_CONSENT', translateService.translate('The application cannot be saved without consent about personal data.'), null, 'AccommodationRequestAction', 'studentConsent');\n } else if (eventHasConsent === true && target.studentConsent === false) {\n const translateService = context.application.getStrategy(function TranslateService() { });\n throw new DataError('E_STUDENT_CONSENT', translateService.translate('The application cannot be saved without consent about personal data.'), null, 'AccommodationRequestAction', 'studentConsent');\n }\n }\n\n if (target && (Object.prototype.hasOwnProperty.call(target, 'category') === false || (target.category == null))) {\n throw new HttpForbiddenError(\n context.__(\n 'The accommodation request creation failed because no request category has been set.'\n )\n );\n }\n\n runAllRules = true;\n }\n \n \n\n if (runAllRules){\n // set nullable fields to null when they don't need to have a value\n let model = event.target;\n \n if (Object.prototype.hasOwnProperty.call(model, 'militaryActive')) {\n if (model.militaryActive == true) {\n applyRulesForPrerequisites(model);\n return;\n } \n }\n\n if (Object.prototype.hasOwnProperty.call(model, 'militarySchool')) {\n if (model.militarySchool == true) {\n applyRulesForPrerequisites(model);\n return;\n } \n }\n \n if (Object.prototype.hasOwnProperty.call(model, 'studentHouseResident')) {\n if (model.studentHouseResident == true) {\n applyRulesForPrerequisites(model);\n return;\n } \n }\n \n if (Object.prototype.hasOwnProperty.call(model, 'sameDegreeHolder')) {\n if (model.sameDegreeHolder == true) {\n applyRulesForPrerequisites(model);\n return;\n } \n }\n\n if (Object.prototype.hasOwnProperty.call(model, 'foreignScholarStudent')) {\n if (model.foreignScholarStudent == true) {\n applyRulesForPrerequisites(model);\n return;\n } \n }\n\n\n if (Object.prototype.hasOwnProperty.call(model, 'foreignStudentOrChildOfGreekExpatriate')) {\n if (model.foreignStudentOrChildOfGreekExpatriate == true) { \n applyRulesForCyprusStudentOrForeignStudentOrChildOfGreekExpatriate(model);\n return;\n } \n }\n\n if (Object.prototype.hasOwnProperty.call(model, 'studentReceivesUnemploymentBenefit')) {\n if (model.studentReceivesUnemploymentBenefit == true){\n model.institutionOrClubLocationSameAsStudentPermanentResidence = null;\n model.studentSubmitsTaxReportInGreece = null;\n nullifyFamilyInformation(model);\n nullifyGuardianFinancialInformation(model);\n nullifySpouseFinancialInformation(model);\n nullifyStudentFinancialInformation(model);\n return;\n }\n }\n\n if (Object.prototype.hasOwnProperty.call(model, 'maritalStatus')) {\n if (model.maritalStatus && model.maritalStatus.alternateName == 'single') {\n model.noOfChildren = null;\n nullifySpouseFinancialInformation(model);\n if (model.guardianType.alternateName == 'nobody') {\n model.institutionOrClubLocationSameAsGuardianPermanentResidence = null;\n model.guardianNoOfChildren = null;\n model.numberOfStudyingSiblings = null;\n nullifyGuardianFinancialInformation(model);\n }\n }\n else {\n model.guardianType = null;\n model.institutionOrClubLocationSameAsGuardianPermanentResidence = null;\n model.guardianNoOfChildren = null;\n model.numberOfStudyingSiblings = null;\n nullifyGuardianFinancialInformation(model);\n if (model.maritalStatus && model.maritalStatus.alternateName != 'married') {\n nullifySpouseFinancialInformation(model);\n }\n }\n }\n }\n \n\n} \n\nfunction applyRulesForPrerequisites(model) {\n //nullify all other properties except foreignScholarStudent, inscriptionModeTag, lessThan25yrs and allInformationSubmittedIsTrueConfirmation\n nullifyPersonalInformation(model);\n nullifyFamilyInformation(model);\n nullifyGuardianFinancialInformation(model); \n nullifySpouseFinancialInformation(model);\n nullifyStudentFinancialInformation(model); \n}\n\nfunction applyRulesForCyprusStudentOrForeignStudentOrChildOfGreekExpatriate(model) {\n model.studentAfm = null;\n}\n\nfunction nullifyPersonalInformation(model){\n model.foreignStudentOrChildOfGreekExpatriate = null;\n model.studentDisabledPerson = null;\n model.studentOrphan = null;\n model.studentReceivesUnemploymentBenefit = null;\n model.studentSubmitsTaxReportInGreece = null;\n model.institutionOrClubLocationSameAsStudentPermanentResidence = null;\n}\n\nfunction nullifyFamilyInformation(model){\n model.noOfChildren = null;\n model.maritalStatus = null;\n model.numberOfStudyingSiblings = null;\n model.guardianNoOfChildren = null;\n model.guardianType = null;\n model.institutionOrClubLocationSameAsGuadianPermanentResidence = null;\n}\n\nfunction nullifyGuardianFinancialInformation(model){\n model.studentGuardianTotalIncome = null;\n model.studentGuardianAfm = null;\n model.studentGuardianReceivesUnemploymentBenefit = null;\n model.studentGuardianSubmitsTaxReportInGreece = null;\n}\n\nfunction nullifySpouseFinancialInformation(model){\n model.studentSpouseTotalIncome = null;\n model.studentSpouseAfm = null;\n model.studentSpouseReceivesUnemploymentBenefit = null;\n}\n\nfunction nullifyStudentFinancialInformation(model){\n model.studentTotalIncome = null;\n model.studentAfm = null;\n}\n\nfunction removeAllInformationExceptStatus(model){\n delete model.militaryActive;\n delete model.militarySchool;\n delete model.studentHouseResident;\n delete model.sameDegreeHolder;\n delete model.foreignScholarStudent;\n delete model.lessThan25yrs;\n delete model.institutionOrClubLocationSameAsStudentPermanentResidence;\n delete model.studentDisabledPerson;\n delete model.studentOrphan;\n delete model.numberOfStudyingSiblings ;\n delete model.maritalStatus;\n delete model.noOfChildren;\n delete model.guardianType;\n delete model.institutionOrClubLocationSameAsGuadianPermanentResidence;\n delete model.guardianNoOfChildren;\n delete model.studentReceivesUnemploymentBenefit;\n delete model.studentSubmitsTaxReportInGreece;\n delete model.studentGuardianSubmitsTaxReportInGreece;\n delete model.studentAfm;\n delete model.studentTotalIncome;\n delete model.studentSpouseReceivesUnemploymentBenefit;\n delete model.studentSpouseAfm;\n delete model.studentSpouseTotalIncome;\n delete model.studentGuardianReceivesUnemploymentBenefit ;\n delete model.foreignStudentOrChildOfGreekExpatriate;\n delete model.studentGuardianAfm;\n delete model.studentGuardianTotalIncome;\n delete model.allInformationSubmittedIsTrueConfirmation;\n}\n\nasync function afterSaveAsync(event) {\n // on insert\n\n}\n\nasync function beforeRemoveAsync(event) {\n \n}\n\nasync function afterRemoveAsync(event) {\n const context = event.model.context;\n // try to find if a preference exists for that event\n\n}\n\n/**\n * @param {DataEventArgs} event\n * @param {Function} callback\n */\nexport function beforeSave(event, callback) {\n return beforeSaveAsync(event).then(() => {\n return callback();\n }).catch((err) => {\n return callback(err);\n });\n}\n\n/**\n * @param {DataEventArgs} event\n * @param {Function} callback\n */\nexport function afterSave(event, callback) {\n return afterSaveAsync(event).then(() => {\n return callback();\n }).catch((err) => {\n return callback(err);\n });\n}\n\n/**\n * @param {DataEventArgs} event\n * @param {Function} callback\n */\nexport function afterRemove(event, callback) {\n return afterRemoveAsync(event).then(() => {\n return callback();\n }).catch((err) => {\n return callback(err);\n });\n}\n\n\n/**\n * @param {DataEventArgs} event\n * @param {Function} callback\n */\nexport function beforeRemove(event, callback) {\n return beforeRemoveAsync(event).then(() => {\n return callback();\n }).catch((err) => {\n return callback(err);\n });\n}\n"],"mappings":"+MAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA;AACA,eAAeG,eAAeA,CAACC,KAAK,EAAE;;EAElC,IAAIC,WAAW,GAAG,KAAK;EACvB,MAAMC,IAAI,GAAGF,KAAK,CAACG,KAAK,CAACC,OAAO,CAACF,IAAI;EACrC,MAAMG,MAAM,GAAGL,KAAK,CAACG,KAAK,CAACG,OAAO,CAACN,KAAK,CAACK,MAAM,CAAC;EAChD,MAAMD,OAAO,GAAGJ,KAAK,CAACG,KAAK,CAACC,OAA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OD,QAAQ,EAAE;EACrB,CAAC,CAAC,CAACE,KAAK,CAAC,CAACC,GAAG,KAAK;IACd,OAAOH,QAAQ,CAACG,GAAG,CAAC;EACxB,CAAC,CAAC;AACN"}
|
|
1
|
+
{"version":3,"file":"ValidateActionListener.js","names":["_common","require","_errors","_data","beforeSaveAsync","event","runAllRules","user","model","context","target","convert","studentId","student","action","eventHasConsent","Object","prototype","hasOwnProperty","call","actionID","id","where","equal","select","getItem","DataError","isMe","is","isActive","HttpForbiddenError","accommodationRequestEvent","silent","value","state","translateService","application","getStrategy","TranslateService","translate","studentConsent","category","__","actionStatus","removeAllInformationExceptStatus","alternateName","previous","agent","militaryActive","applyRulesForPrerequisites","militarySchool","studentHouseResident","sameDegreeHolder","foreignScholarStudent","foreignStudentOrChildOfGreekExpatriate","applyRulesForCyprusStudentOrForeignStudentOrChildOfGreekExpatriate","studentReceivesUnemploymentBenefit","institutionOrClubLocationSameAsStudentPermanentResidence","studentSubmitsTaxReportInGreece","nullifyFamilyInformation","nullifyGuardianFinancialInformation","nullifySpouseFinancialInformation","nullifyStudentFinancialInformation","maritalStatus","noOfChildren","guardianType","institutionOrClubLocationSameAsGuardianPermanentResidence","guardianNoOfChildren","numberOfStudyingSiblings","nullifyPersonalInformation","studentAfm","studentDisabledPerson","studentOrphan","institutionOrClubLocationSameAsGuadianPermanentResidence","studentGuardianTotalIncome","studentGuardianAfm","studentGuardianReceivesUnemploymentBenefit","studentGuardianSubmitsTaxReportInGreece","studentSpouseTotalIncome","studentSpouseAfm","studentSpouseReceivesUnemploymentBenefit","studentTotalIncome","lessThan25yrs","allInformationSubmittedIsTrueConfirmation","afterSaveAsync","beforeRemoveAsync","afterRemoveAsync","beforeSave","callback","then","catch","err","afterSave","afterRemove","beforeRemove"],"sources":["../../src/listeners/ValidateActionListener.js"],"sourcesContent":["import {DataError} from \"@themost/common\";\nimport { HttpForbiddenError } from '@themost/common/errors';\nimport { DataObjectState, DataModel } from \"@themost/data\";\n// eslint-disable-next-line no-unused-vars\nasync function beforeSaveAsync(event) {\n\n let runAllRules = false;\n const user = event.model.context.user;\n const target = event.model.convert(event.target);\n const context = event.model.context;\n\n let studentId = target.student;\n let action;\n let eventHasConsent;\n\n if (!Object.prototype.hasOwnProperty.call(target,'student')) {\n const actionID = event.target || event.target.id;\n action = await context.model('AccommodationRequestAction')\n .where('id')\n .equal(actionID)\n .select('student','accommodationRequestEvent/hasConsent as hasConsent','studentConsent')\n .getItem();\n studentId = action.student;\n }\n if (!studentId) {\n throw new DataError('E_STUDENT', 'The student cannot be empty at this context.');\n }\n\n const student = event.model.context.model('Student').convert(studentId);\n \n const isMe = await student.is(':me');\n if (isMe) {\n const isActive = await student.is(':active');\n if (!isActive) {\n throw new HttpForbiddenError();\n }\n\n const accommodationRequestEvent = target.accommodationRequestEvent || target.accommodationRequestEvent.id;\n eventHasConsent = await context.model('AccommodationRequestEvent')\n .where('id')\n .equal(accommodationRequestEvent)\n .select('hasConsent')\n .silent()\n .value();\n }\n\n if (event.state === 2) {\n if (isMe === true) {\n //check studentConsent\n if (event.target && eventHasConsent === true && Object.prototype.hasOwnProperty.call(target, 'studentConsent') === false) {\n const translateService = context.application.getStrategy(function TranslateService() { });\n throw new DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');\n } else if (event.target && eventHasConsent === true && Object.prototype.hasOwnProperty.call(target, 'studentConsent') === true && target.studentConsent === false) {\n const translateService = context.application.getStrategy(function TranslateService() { });\n throw new DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');\n }\n //check category\n if (target && (Object.prototype.hasOwnProperty.call(target, 'category') && (target.category == null))) {\n throw new HttpForbiddenError(\n context.__(\n 'The accommodation request creation failed because no request category has been set.'\n )\n );\n }\n\n }\n\n //UPDATE\n //Load current status\n const actionStatus = await event.model.where('id').equal(event.target.id).select('actionStatus/alternateName').value();\n \n //Action is not submitted yet. Run again all rules\n if (actionStatus === 'PotentialActionStatus') {\n runAllRules = true;\n }\n else if (actionStatus === 'ActiveActionStatus' || actionStatus === 'CompletedActionStatus'){\n //accommodation request already submitted. Do not allow to update any property \n removeAllInformationExceptStatus(event.target);\n }\n else if (actionStatus === 'CancelledActionStatus' && event.target.actionStatus && event.target.actionStatus.alternateName !== actionStatus && event.target.actionStatus.alternateName != 'ActiveActionStatus') {\n //accommodation request already cancelled. \n throw new DataError('E_VALUE', 'Cannot update cancelled action.', null, 'AccommodationRequestAction', 'actionStatus');\n }\n // allow agent to change request's status when target request status = 'ActiveActionStatus' example: to reconsider a cancelled request\n else if (actionStatus === 'CancelledActionStatus' && event.target.actionStatus && event.target.actionStatus.alternateName !== actionStatus && event.target.actionStatus.alternateName === 'ActiveActionStatus') {\n let model = event.target;\n // set loggedIn user as request's agent\n if (event.previous.agent != user.id) {\n model.agent = user.id;\n }\n }\n }\n\n else if (event.state === 1) {\n // check studentConsent\n if (isMe === true && eventHasConsent === true) {\n if (Object.prototype.hasOwnProperty.call(target, 'studentConsent') === false) {\n const translateService = context.application.getStrategy(function TranslateService() { });\n throw new DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');\n } else if (eventHasConsent === true && target.studentConsent === false) {\n const translateService = context.application.getStrategy(function TranslateService() { });\n throw new DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');\n }\n }\n\n if (target && (Object.prototype.hasOwnProperty.call(target, 'category') === false || (target.category == null))) {\n throw new HttpForbiddenError(\n context.__(\n 'The accommodation request creation failed because no request category has been set.'\n )\n );\n }\n\n runAllRules = true;\n }\n \n \n\n if (runAllRules){\n // set nullable fields to null when they don't need to have a value\n let model = event.target;\n \n if (Object.prototype.hasOwnProperty.call(model, 'militaryActive')) {\n if (model.militaryActive == true) {\n applyRulesForPrerequisites(model);\n return;\n } \n }\n\n if (Object.prototype.hasOwnProperty.call(model, 'militarySchool')) {\n if (model.militarySchool == true) {\n applyRulesForPrerequisites(model);\n return;\n } \n }\n \n if (Object.prototype.hasOwnProperty.call(model, 'studentHouseResident')) {\n if (model.studentHouseResident == true) {\n applyRulesForPrerequisites(model);\n return;\n } \n }\n \n if (Object.prototype.hasOwnProperty.call(model, 'sameDegreeHolder')) {\n if (model.sameDegreeHolder == true) {\n applyRulesForPrerequisites(model);\n return;\n } \n }\n\n if (Object.prototype.hasOwnProperty.call(model, 'foreignScholarStudent')) {\n if (model.foreignScholarStudent == true) {\n applyRulesForPrerequisites(model);\n return;\n } \n }\n\n\n if (Object.prototype.hasOwnProperty.call(model, 'foreignStudentOrChildOfGreekExpatriate')) {\n if (model.foreignStudentOrChildOfGreekExpatriate == true) { \n applyRulesForCyprusStudentOrForeignStudentOrChildOfGreekExpatriate(model);\n return;\n } \n }\n\n if (Object.prototype.hasOwnProperty.call(model, 'studentReceivesUnemploymentBenefit')) {\n if (model.studentReceivesUnemploymentBenefit == true){\n model.institutionOrClubLocationSameAsStudentPermanentResidence = null;\n model.studentSubmitsTaxReportInGreece = null;\n nullifyFamilyInformation(model);\n nullifyGuardianFinancialInformation(model);\n nullifySpouseFinancialInformation(model);\n nullifyStudentFinancialInformation(model);\n return;\n }\n }\n\n if (Object.prototype.hasOwnProperty.call(model, 'maritalStatus')) {\n if (model.maritalStatus && model.maritalStatus.alternateName == 'single') {\n model.noOfChildren = null;\n nullifySpouseFinancialInformation(model);\n if (model.guardianType.alternateName == 'nobody') {\n model.institutionOrClubLocationSameAsGuardianPermanentResidence = null;\n model.guardianNoOfChildren = null;\n model.numberOfStudyingSiblings = null;\n nullifyGuardianFinancialInformation(model);\n }\n }\n else {\n model.guardianType = null;\n model.institutionOrClubLocationSameAsGuardianPermanentResidence = null;\n model.guardianNoOfChildren = null;\n model.numberOfStudyingSiblings = null;\n nullifyGuardianFinancialInformation(model);\n if (model.maritalStatus && model.maritalStatus.alternateName != 'married') {\n nullifySpouseFinancialInformation(model);\n }\n }\n }\n }\n \n\n} \n\nfunction applyRulesForPrerequisites(model) {\n //nullify all other properties except foreignScholarStudent, inscriptionModeTag, lessThan25yrs and allInformationSubmittedIsTrueConfirmation\n nullifyPersonalInformation(model);\n nullifyFamilyInformation(model);\n nullifyGuardianFinancialInformation(model); \n nullifySpouseFinancialInformation(model);\n nullifyStudentFinancialInformation(model); \n}\n\nfunction applyRulesForCyprusStudentOrForeignStudentOrChildOfGreekExpatriate(model) {\n model.studentAfm = null;\n}\n\nfunction nullifyPersonalInformation(model){\n model.foreignStudentOrChildOfGreekExpatriate = null;\n model.studentDisabledPerson = null;\n model.studentOrphan = null;\n model.studentReceivesUnemploymentBenefit = null;\n model.studentSubmitsTaxReportInGreece = null;\n model.institutionOrClubLocationSameAsStudentPermanentResidence = null;\n}\n\nfunction nullifyFamilyInformation(model){\n model.noOfChildren = null;\n model.maritalStatus = null;\n model.numberOfStudyingSiblings = null;\n model.guardianNoOfChildren = null;\n model.guardianType = null;\n model.institutionOrClubLocationSameAsGuadianPermanentResidence = null;\n}\n\nfunction nullifyGuardianFinancialInformation(model){\n model.studentGuardianTotalIncome = null;\n model.studentGuardianAfm = null;\n model.studentGuardianReceivesUnemploymentBenefit = null;\n model.studentGuardianSubmitsTaxReportInGreece = null;\n}\n\nfunction nullifySpouseFinancialInformation(model){\n model.studentSpouseTotalIncome = null;\n model.studentSpouseAfm = null;\n model.studentSpouseReceivesUnemploymentBenefit = null;\n}\n\nfunction nullifyStudentFinancialInformation(model){\n model.studentTotalIncome = null;\n model.studentAfm = null;\n}\n\nfunction removeAllInformationExceptStatus(model){\n delete model.militaryActive;\n delete model.militarySchool;\n delete model.studentHouseResident;\n delete model.sameDegreeHolder;\n delete model.foreignScholarStudent;\n delete model.lessThan25yrs;\n delete model.institutionOrClubLocationSameAsStudentPermanentResidence;\n delete model.studentDisabledPerson;\n delete model.studentOrphan;\n delete model.numberOfStudyingSiblings ;\n delete model.maritalStatus;\n delete model.noOfChildren;\n delete model.guardianType;\n delete model.institutionOrClubLocationSameAsGuadianPermanentResidence;\n delete model.guardianNoOfChildren;\n delete model.studentReceivesUnemploymentBenefit;\n delete model.studentSubmitsTaxReportInGreece;\n delete model.studentGuardianSubmitsTaxReportInGreece;\n delete model.studentAfm;\n delete model.studentTotalIncome;\n delete model.studentSpouseReceivesUnemploymentBenefit;\n delete model.studentSpouseAfm;\n delete model.studentSpouseTotalIncome;\n delete model.studentGuardianReceivesUnemploymentBenefit ;\n delete model.foreignStudentOrChildOfGreekExpatriate;\n delete model.studentGuardianAfm;\n delete model.studentGuardianTotalIncome;\n delete model.allInformationSubmittedIsTrueConfirmation;\n}\n\nasync function afterSaveAsync(event) {\n // on insert\n\n}\n\nasync function beforeRemoveAsync(event) {\n \n}\n\nasync function afterRemoveAsync(event) {\n const context = event.model.context;\n // try to find if a preference exists for that event\n\n}\n\n/**\n * @param {DataEventArgs} event\n * @param {Function} callback\n */\nexport function beforeSave(event, callback) {\n return beforeSaveAsync(event).then(() => {\n return callback();\n }).catch((err) => {\n return callback(err);\n });\n}\n\n/**\n * @param {DataEventArgs} event\n * @param {Function} callback\n */\nexport function afterSave(event, callback) {\n return afterSaveAsync(event).then(() => {\n return callback();\n }).catch((err) => {\n return callback(err);\n });\n}\n\n/**\n * @param {DataEventArgs} event\n * @param {Function} callback\n */\nexport function afterRemove(event, callback) {\n return afterRemoveAsync(event).then(() => {\n return callback();\n }).catch((err) => {\n return callback(err);\n });\n}\n\n\n/**\n * @param {DataEventArgs} event\n * @param {Function} callback\n */\nexport function beforeRemove(event, callback) {\n return beforeRemoveAsync(event).then(() => {\n return callback();\n }).catch((err) => {\n return callback(err);\n });\n}\n"],"mappings":"+MAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OA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CAACjF,KAAK,CAAC,CAACoF,IAAI,CAAC,MAAM;IACtC,OAAOD,QAAQ,EAAE;EACrB,CAAC,CAAC,CAACE,KAAK,CAAC,CAACC,GAAG,KAAK;IACd,OAAOH,QAAQ,CAACG,GAAG,CAAC;EACxB,CAAC,CAAC;AACN;;;AAGA;AACA;AACA;AACA;AACO,SAASG,YAAYA,CAACzF,KAAK,EAAEmF,QAAQ,EAAE;EAC1C,OAAOH,iBAAiB,CAAChF,KAAK,CAAC,CAACoF,IAAI,CAAC,MAAM;IACvC,OAAOD,QAAQ,EAAE;EACrB,CAAC,CAAC,CAACE,KAAK,CAAC,CAACC,GAAG,KAAK;IACd,OAAOH,QAAQ,CAACG,GAAG,CAAC;EACxB,CAAC,CAAC;AACN"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
{
|
|
2
|
+
"The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.": "Η αίτηση δεν μπορεί να αποθηκευτεί χωρίς ο φοιτητής να δηλώσει ότι έχει λάβει γνώση της Πολιτικής Προστασίας της Ιδιωτικότητας και των Προσωπικών Δεδομένων."
|
|
3
|
+
}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"sealed": false,
|
|
9
9
|
"implements": "Place",
|
|
10
10
|
"classPath": "./models/Accommodation",
|
|
11
|
-
"version": "1.
|
|
11
|
+
"version": "1.6",
|
|
12
12
|
"fields": [
|
|
13
13
|
{
|
|
14
14
|
"@id": "http://schema.org/identifier",
|
|
@@ -66,9 +66,49 @@
|
|
|
66
66
|
"description": "The geo coordinates of the accommodation.",
|
|
67
67
|
"type": "Json",
|
|
68
68
|
"additionalType": "GeoCoordinates"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "locales",
|
|
72
|
+
"type": "AccommodationLocale",
|
|
73
|
+
"mapping": {
|
|
74
|
+
"associationType": "association",
|
|
75
|
+
"cascade": "delete",
|
|
76
|
+
"parentModel": "Accommodation",
|
|
77
|
+
"parentField": "id",
|
|
78
|
+
"childModel": "AccommodationLocale",
|
|
79
|
+
"childField": "object"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "locale",
|
|
84
|
+
"type": "AccommodationLocale",
|
|
85
|
+
"readonly": true,
|
|
86
|
+
"editable": false,
|
|
87
|
+
"many": true,
|
|
88
|
+
"expandable": true,
|
|
89
|
+
"multiplicity": "ZeroOrOne",
|
|
90
|
+
"mapping": {
|
|
91
|
+
"associationType": "association",
|
|
92
|
+
"cascade": "delete",
|
|
93
|
+
"parentModel": "Accommodation",
|
|
94
|
+
"parentField": "id",
|
|
95
|
+
"childModel": "AccommodationLocale",
|
|
96
|
+
"childField": "object",
|
|
97
|
+
"options": {
|
|
98
|
+
"$filter": "inLanguage eq lang()",
|
|
99
|
+
"$first": true
|
|
100
|
+
}
|
|
101
|
+
}
|
|
69
102
|
}
|
|
70
103
|
],
|
|
71
|
-
"eventListeners": [
|
|
104
|
+
"eventListeners": [
|
|
105
|
+
{
|
|
106
|
+
"type": "@themost/data/previous-state-listener"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"type": "./listeners/data-localization"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
72
112
|
"constraints": [
|
|
73
113
|
{
|
|
74
114
|
"type": "unique",
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://themost-framework.github.io/themost/models/2018/2/schema.json",
|
|
3
|
+
"@id": "https://universis.io/entities/AccommodationLocale",
|
|
4
|
+
"name": "AccommodationLocale",
|
|
5
|
+
"description": "Contains a collection of extra field required for accommodation.",
|
|
6
|
+
"title": "AccommodationLocale",
|
|
7
|
+
"abstract": false,
|
|
8
|
+
"contains": "Accommodation",
|
|
9
|
+
"hidden": true,
|
|
10
|
+
"sealed": false,
|
|
11
|
+
"version": "1.0",
|
|
12
|
+
"fields": [
|
|
13
|
+
{
|
|
14
|
+
"@id": "https://themost.io/schemas/id",
|
|
15
|
+
"name": "id",
|
|
16
|
+
"title": "ID",
|
|
17
|
+
"description": "The identifier of the item.",
|
|
18
|
+
"type": "Counter",
|
|
19
|
+
"primary": true,
|
|
20
|
+
"nullable": false
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"@id": "https://themost.io/schemas/object",
|
|
24
|
+
"name": "object",
|
|
25
|
+
"title": "object",
|
|
26
|
+
"description": "The parent item.",
|
|
27
|
+
"type": "Accommodation"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"@id": "http://schema.org/inLanguage",
|
|
31
|
+
"name": "inLanguage",
|
|
32
|
+
"title": "inLanguage",
|
|
33
|
+
"description": "The language of this item.",
|
|
34
|
+
"type": "Text",
|
|
35
|
+
"size": 5
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "name",
|
|
39
|
+
"title": "Ονομασία",
|
|
40
|
+
"description": "Η ονομασία του αντικειμένου",
|
|
41
|
+
"type": "Text",
|
|
42
|
+
"nullable": true,
|
|
43
|
+
"size": 100
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "description",
|
|
47
|
+
"title": "Περιγραφή",
|
|
48
|
+
"description": "Περιγραφή του τύπου εργασίας",
|
|
49
|
+
"type": "Text",
|
|
50
|
+
"nullable": true,
|
|
51
|
+
"size": 80
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "displayCode",
|
|
55
|
+
"title": "Display code",
|
|
56
|
+
"description": "The display code of the place",
|
|
57
|
+
"type": "Text",
|
|
58
|
+
"size": 15
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"constraints": [
|
|
62
|
+
{
|
|
63
|
+
"type": "unique",
|
|
64
|
+
"fields": [
|
|
65
|
+
"object",
|
|
66
|
+
"inLanguage"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"privileges": [
|
|
71
|
+
{
|
|
72
|
+
"mask": 1,
|
|
73
|
+
"type": "global",
|
|
74
|
+
"account": "*"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"mask": 15,
|
|
78
|
+
"type": "global"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"mask": 15,
|
|
82
|
+
"type": "global",
|
|
83
|
+
"account": "Administrators"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"abstract": false,
|
|
8
8
|
"sealed": false,
|
|
9
9
|
"implements": "Accommodation",
|
|
10
|
-
"version": "
|
|
10
|
+
"version": "2.0.1",
|
|
11
11
|
"fields": [
|
|
12
12
|
{
|
|
13
13
|
"name": "bed",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"size": 500
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
"name": "
|
|
18
|
+
"name": "floor",
|
|
19
19
|
"type": "Text",
|
|
20
20
|
"size": 500
|
|
21
21
|
},
|
|
@@ -128,9 +128,48 @@
|
|
|
128
128
|
"name": "reasonOutOfService",
|
|
129
129
|
"type": "Text",
|
|
130
130
|
"size": 500
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "locales",
|
|
134
|
+
"type": "AccommodationRoomLocale",
|
|
135
|
+
"mapping": {
|
|
136
|
+
"associationType": "association",
|
|
137
|
+
"cascade": "delete",
|
|
138
|
+
"parentModel": "AccommodationRoom",
|
|
139
|
+
"parentField": "id",
|
|
140
|
+
"childModel": "AccommodationRoomLocale",
|
|
141
|
+
"childField": "object"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "locale",
|
|
146
|
+
"type": "AccommodationRoomLocale",
|
|
147
|
+
"readonly": true,
|
|
148
|
+
"editable": false,
|
|
149
|
+
"many": true,
|
|
150
|
+
"expandable": true,
|
|
151
|
+
"multiplicity": "ZeroOrOne",
|
|
152
|
+
"mapping": {
|
|
153
|
+
"associationType": "association",
|
|
154
|
+
"cascade": "delete",
|
|
155
|
+
"parentModel": "AccommodationRoom",
|
|
156
|
+
"parentField": "id",
|
|
157
|
+
"childModel": "AccommodationRoomLocale",
|
|
158
|
+
"childField": "object",
|
|
159
|
+
"options": {
|
|
160
|
+
"$filter": "inLanguage eq lang()",
|
|
161
|
+
"$first": true
|
|
162
|
+
}
|
|
163
|
+
}
|
|
131
164
|
}
|
|
132
165
|
],
|
|
133
166
|
"eventListeners": [
|
|
167
|
+
{
|
|
168
|
+
"type": "@themost/data/previous-state-listener"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"type": "./listeners/data-localization"
|
|
172
|
+
}
|
|
134
173
|
],
|
|
135
174
|
"privileges": [
|
|
136
175
|
{
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://themost-framework.github.io/themost/models/2018/2/schema.json",
|
|
3
|
+
"@id": "https://universis.io/entities/AccommodationRoomLocale",
|
|
4
|
+
"name": "AccommodationRoomLocale",
|
|
5
|
+
"description": "Contains a collection of extra field required for accommodation room.",
|
|
6
|
+
"title": "AccommodationRoomLocale",
|
|
7
|
+
"abstract": false,
|
|
8
|
+
"contains": "AccommodationRoom",
|
|
9
|
+
"hidden": true,
|
|
10
|
+
"sealed": false,
|
|
11
|
+
"version": "1.0",
|
|
12
|
+
"fields": [
|
|
13
|
+
{
|
|
14
|
+
"@id": "https://themost.io/schemas/id",
|
|
15
|
+
"name": "id",
|
|
16
|
+
"title": "ID",
|
|
17
|
+
"description": "The identifier of the item.",
|
|
18
|
+
"type": "Counter",
|
|
19
|
+
"primary": true,
|
|
20
|
+
"nullable": false
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"@id": "https://themost.io/schemas/object",
|
|
24
|
+
"name": "object",
|
|
25
|
+
"title": "object",
|
|
26
|
+
"description": "The parent item.",
|
|
27
|
+
"type": "AccommodationRoom"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"@id": "http://schema.org/inLanguage",
|
|
31
|
+
"name": "inLanguage",
|
|
32
|
+
"title": "inLanguage",
|
|
33
|
+
"description": "The language of this item.",
|
|
34
|
+
"type": "Text",
|
|
35
|
+
"size": 5
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "name",
|
|
39
|
+
"title": "Ονομασία",
|
|
40
|
+
"description": "Η ονομασία του αντικειμένου",
|
|
41
|
+
"type": "Text",
|
|
42
|
+
"nullable": true,
|
|
43
|
+
"size": 100
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "description",
|
|
47
|
+
"title": "Περιγραφή",
|
|
48
|
+
"description": "Περιγραφή του τύπου εργασίας",
|
|
49
|
+
"type": "Text",
|
|
50
|
+
"nullable": true,
|
|
51
|
+
"size": 80
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "displayCode",
|
|
55
|
+
"title": "Display code",
|
|
56
|
+
"description": "The display code of the place",
|
|
57
|
+
"type": "Text",
|
|
58
|
+
"size": 15
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"constraints": [
|
|
62
|
+
{
|
|
63
|
+
"type": "unique",
|
|
64
|
+
"fields": [
|
|
65
|
+
"object",
|
|
66
|
+
"inLanguage"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"privileges": [
|
|
71
|
+
{
|
|
72
|
+
"mask": 1,
|
|
73
|
+
"type": "global",
|
|
74
|
+
"account": "*"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"mask": 15,
|
|
78
|
+
"type": "global"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"mask": 15,
|
|
82
|
+
"type": "global",
|
|
83
|
+
"account": "Administrators"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
@@ -49,10 +49,10 @@ async function beforeSaveAsync(event) {
|
|
|
49
49
|
//check studentConsent
|
|
50
50
|
if (event.target && eventHasConsent === true && Object.prototype.hasOwnProperty.call(target, 'studentConsent') === false) {
|
|
51
51
|
const translateService = context.application.getStrategy(function TranslateService() { });
|
|
52
|
-
throw new DataError('E_STUDENT_CONSENT', translateService.translate('The
|
|
52
|
+
throw new DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');
|
|
53
53
|
} else if (event.target && eventHasConsent === true && Object.prototype.hasOwnProperty.call(target, 'studentConsent') === true && target.studentConsent === false) {
|
|
54
54
|
const translateService = context.application.getStrategy(function TranslateService() { });
|
|
55
|
-
throw new DataError('E_STUDENT_CONSENT', translateService.translate('The
|
|
55
|
+
throw new DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');
|
|
56
56
|
}
|
|
57
57
|
//check category
|
|
58
58
|
if (target && (Object.prototype.hasOwnProperty.call(target, 'category') && (target.category == null))) {
|
|
@@ -96,10 +96,10 @@ async function beforeSaveAsync(event) {
|
|
|
96
96
|
if (isMe === true && eventHasConsent === true) {
|
|
97
97
|
if (Object.prototype.hasOwnProperty.call(target, 'studentConsent') === false) {
|
|
98
98
|
const translateService = context.application.getStrategy(function TranslateService() { });
|
|
99
|
-
throw new DataError('E_STUDENT_CONSENT', translateService.translate('The
|
|
99
|
+
throw new DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');
|
|
100
100
|
} else if (eventHasConsent === true && target.studentConsent === false) {
|
|
101
101
|
const translateService = context.application.getStrategy(function TranslateService() { });
|
|
102
|
-
throw new DataError('E_STUDENT_CONSENT', translateService.translate('The
|
|
102
|
+
throw new DataError('E_STUDENT_CONSENT', translateService.translate('The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.'), null, 'AccommodationRequestAction', 'studentConsent');
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
{
|
|
2
|
+
"The request cannot be submitted unless the student confirms that they have read and understood the Privacy and Personal Data Protection Policy.": "Η αίτηση δεν μπορεί να αποθηκευτεί χωρίς ο φοιτητής να δηλώσει ότι έχει λάβει γνώση της Πολιτικής Προστασίας της Ιδιωτικότητας και των Προσωπικών Δεδομένων."
|
|
3
|
+
}
|