@universis/accommodation 1.0.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/.gitlab-ci.yml +23 -0
- package/LICENSE +163 -0
- package/README.md +3 -0
- package/dist/AccommodationSchemaLoader.js +35 -0
- package/dist/AccommodationSchemaLoader.js.map +1 -0
- package/dist/AccommodationService.js +68 -0
- package/dist/AccommodationService.js.map +1 -0
- package/dist/DepartmentReplacer.js +54 -0
- package/dist/DepartmentReplacer.js.map +1 -0
- package/dist/StudentReplacer.js +75 -0
- package/dist/StudentReplacer.js.map +1 -0
- package/dist/config/models/Accommodation.json +96 -0
- package/dist/config/models/AccommodationCardEffectiveStatusType.json +107 -0
- package/dist/config/models/AccommodationCardEffectiveStatusTypeLocale.json +85 -0
- package/dist/config/models/AccommodationChildFinancialAttribute.json +46 -0
- package/dist/config/models/AccommodationGuardianFinancialAttribute.json +46 -0
- package/dist/config/models/AccommodationInscriptionModeTag.json +100 -0
- package/dist/config/models/AccommodationRequestAction.json +500 -0
- package/dist/config/models/AccommodationRequestActionMessage.json +46 -0
- package/dist/config/models/AccommodationRequestActionReview.json +31 -0
- package/dist/config/models/AccommodationRequestAttachmentConfiguration.json +72 -0
- package/dist/config/models/AccommodationRequestCategory.json +50 -0
- package/dist/config/models/AccommodationRequestEffectiveStatusType.json +212 -0
- package/dist/config/models/AccommodationRequestEffectiveStatusTypeLocale.json +85 -0
- package/dist/config/models/AccommodationRequestEvent.json +117 -0
- package/dist/config/models/AccommodationRequestFinancialAttribute.json +53 -0
- package/dist/config/models/AccommodationRoom.json +151 -0
- package/dist/config/models/AccommodationSiblingFinancialAttribute.json +57 -0
- package/dist/config/models/CancelAccommodationCardAction.json +32 -0
- package/dist/config/models/GuardianType.json +78 -0
- package/dist/config/models/Review.json +50 -0
- package/dist/config/models/RoomType.json +320 -0
- package/dist/config/models/RoomTypeLocale.json +86 -0
- package/dist/config/models/StudentAccommodationCard.json +158 -0
- package/dist/config/models/TestAction.json +50 -0
- package/dist/config/scope.access.js +148 -0
- package/dist/config/scope.access.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/listeners/AddDefaultAttachmentConfiguration.js +44 -0
- package/dist/listeners/AddDefaultAttachmentConfiguration.js.map +1 -0
- package/dist/listeners/DefaultAttachmentConfigurations.json +277 -0
- package/dist/listeners/DefaultAttachmentTypes.json +523 -0
- package/dist/listeners/GenerateRequestNumberListener.js +87 -0
- package/dist/listeners/GenerateRequestNumberListener.js.map +1 -0
- package/dist/listeners/OnActionCompleteListener.js +96 -0
- package/dist/listeners/OnActionCompleteListener.js.map +1 -0
- package/dist/listeners/OnCancelAccommodationCardListener.js +87 -0
- package/dist/listeners/OnCancelAccommodationCardListener.js.map +1 -0
- package/dist/listeners/OnReactivateAccommodationCardListener.js +87 -0
- package/dist/listeners/OnReactivateAccommodationCardListener.js.map +1 -0
- package/dist/listeners/SendEmailAfterActionStatusChangeListener.js +98 -0
- package/dist/listeners/SendEmailAfterActionStatusChangeListener.js.map +1 -0
- package/dist/listeners/SendEmailAfterCardStatusChangeListener.js +139 -0
- package/dist/listeners/SendEmailAfterCardStatusChangeListener.js.map +1 -0
- package/dist/listeners/StudentAccommodationCardSaveListener.js +90 -0
- package/dist/listeners/StudentAccommodationCardSaveListener.js.map +1 -0
- package/dist/listeners/UpdateStudentAccommodationCardListener.js +70 -0
- package/dist/listeners/UpdateStudentAccommodationCardListener.js.map +1 -0
- package/dist/listeners/ValidateActionListener.js +348 -0
- package/dist/listeners/ValidateActionListener.js.map +1 -0
- package/dist/listeners/data-localization.js +209 -0
- package/dist/listeners/data-localization.js.map +1 -0
- package/dist/listeners/lookup-cache-listener.js +90 -0
- package/dist/listeners/lookup-cache-listener.js.map +1 -0
- package/dist/models/Accommodation.js +53 -0
- package/dist/models/Accommodation.js.map +1 -0
- package/dist/models/AccommodationRequestAction.js +214 -0
- package/dist/models/AccommodationRequestAction.js.map +1 -0
- package/dist/models/AccommodationRequestEvent.js +277 -0
- package/dist/models/AccommodationRequestEvent.js.map +1 -0
- package/dist/models/EnableAttachmentModel.js +210 -0
- package/dist/models/EnableAttachmentModel.js.map +1 -0
- package/dist/models/StudentAccommodationCard.js +93 -0
- package/dist/models/StudentAccommodationCard.js.map +1 -0
- package/dist/models/TestAction.d.ts +5 -0
- package/dist/models/TestAction.js +5 -0
- package/dist/models/TestAction.js.map +1 -0
- package/dist/templates/mail-after-dining-request-status-change/html.ejs +27 -0
- package/package.json +57 -0
- package/src/AccommodationSchemaLoader.js +35 -0
- package/src/AccommodationService.js +67 -0
- package/src/DepartmentReplacer.js +53 -0
- package/src/StudentReplacer.js +74 -0
- package/src/config/models/Accommodation.json +96 -0
- package/src/config/models/AccommodationCardEffectiveStatusType.json +107 -0
- package/src/config/models/AccommodationCardEffectiveStatusTypeLocale.json +85 -0
- package/src/config/models/AccommodationChildFinancialAttribute.json +46 -0
- package/src/config/models/AccommodationGuardianFinancialAttribute.json +46 -0
- package/src/config/models/AccommodationInscriptionModeTag.json +100 -0
- package/src/config/models/AccommodationRequestAction.json +500 -0
- package/src/config/models/AccommodationRequestActionMessage.json +46 -0
- package/src/config/models/AccommodationRequestActionReview.json +31 -0
- package/src/config/models/AccommodationRequestAttachmentConfiguration.json +72 -0
- package/src/config/models/AccommodationRequestCategory.json +50 -0
- package/src/config/models/AccommodationRequestEffectiveStatusType.json +212 -0
- package/src/config/models/AccommodationRequestEffectiveStatusTypeLocale.json +85 -0
- package/src/config/models/AccommodationRequestEvent.json +117 -0
- package/src/config/models/AccommodationRequestFinancialAttribute.json +53 -0
- package/src/config/models/AccommodationRoom.json +151 -0
- package/src/config/models/AccommodationSiblingFinancialAttribute.json +57 -0
- package/src/config/models/CancelAccommodationCardAction.json +32 -0
- package/src/config/models/GuardianType.json +78 -0
- package/src/config/models/Review.json +50 -0
- package/src/config/models/RoomType.json +320 -0
- package/src/config/models/RoomTypeLocale.json +86 -0
- package/src/config/models/StudentAccommodationCard.json +158 -0
- package/src/config/models/TestAction.json +50 -0
- package/src/config/scope.access.js +148 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/listeners/AddDefaultAttachmentConfiguration.js +43 -0
- package/src/listeners/DefaultAttachmentConfigurations.json +277 -0
- package/src/listeners/DefaultAttachmentTypes.json +523 -0
- package/src/listeners/GenerateRequestNumberListener.js +86 -0
- package/src/listeners/OnActionCompleteListener.js +95 -0
- package/src/listeners/OnCancelAccommodationCardListener.js +86 -0
- package/src/listeners/OnReactivateAccommodationCardListener.js +86 -0
- package/src/listeners/SendEmailAfterActionStatusChangeListener.js +97 -0
- package/src/listeners/SendEmailAfterCardStatusChangeListener.js +138 -0
- package/src/listeners/StudentAccommodationCardSaveListener.js +89 -0
- package/src/listeners/UpdateStudentAccommodationCardListener.js +69 -0
- package/src/listeners/ValidateActionListener.js +347 -0
- package/src/listeners/data-localization.js +214 -0
- package/src/listeners/lookup-cache-listener.js +89 -0
- package/src/models/Accommodation.js +52 -0
- package/src/models/AccommodationRequestAction.js +195 -0
- package/src/models/AccommodationRequestEvent.js +276 -0
- package/src/models/EnableAttachmentModel.js +209 -0
- package/src/models/StudentAccommodationCard.js +92 -0
- package/src/models/TestAction.d.ts +5 -0
- package/src/models/TestAction.js +10 -0
- package/src/templates/mail-after-dining-request-status-change/html.ejs +27 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://themost-framework.github.io/themost/models/2018/2/schema.json",
|
|
3
|
+
"@id": "https://universis.io/schemas/StudentAccommodationCard",
|
|
4
|
+
"name": "StudentAccommodationCard",
|
|
5
|
+
"title": "StudentAccommodationCard",
|
|
6
|
+
"hidden": false,
|
|
7
|
+
"sealed": false,
|
|
8
|
+
"version": "1.5",
|
|
9
|
+
"source": "StudentAccommodationCardBase",
|
|
10
|
+
"view": "StudentAccommodationCardData",
|
|
11
|
+
"classPath": "./models/StudentAccommodationCard",
|
|
12
|
+
"fields": [
|
|
13
|
+
{
|
|
14
|
+
"name": "id",
|
|
15
|
+
"title": "Κωδικός",
|
|
16
|
+
"description": "Ο κωδικός της εγγραφής",
|
|
17
|
+
"type": "Counter",
|
|
18
|
+
"primary": true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "action",
|
|
22
|
+
"title": "Action",
|
|
23
|
+
"description": "The action associated with this card.",
|
|
24
|
+
"type": "AccommodationRequestAction",
|
|
25
|
+
"nullable": false
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "student",
|
|
29
|
+
"title": "Φοιτητής",
|
|
30
|
+
"description": "Ο φοιτητής",
|
|
31
|
+
"type": "Student",
|
|
32
|
+
"nullable": false,
|
|
33
|
+
"editable": false
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "accommodationRoom",
|
|
37
|
+
"title": "Δωμάτιο",
|
|
38
|
+
"description": "Δωμάτιο",
|
|
39
|
+
"type": "AccommodationRoom",
|
|
40
|
+
"nullable": true,
|
|
41
|
+
"editable": true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"@id": "https://universis.io/properties/academicYear",
|
|
45
|
+
"name": "academicYear",
|
|
46
|
+
"title": "Academic year",
|
|
47
|
+
"type": "AcademicYear",
|
|
48
|
+
"expandable": true,
|
|
49
|
+
"nullable": false
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
{
|
|
53
|
+
"name": "serialNumber",
|
|
54
|
+
"title": "Number",
|
|
55
|
+
"type": "Integer",
|
|
56
|
+
"nullable": false,
|
|
57
|
+
"value": "javascript:return this.newid();"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "dateCreated",
|
|
61
|
+
"title": "Date Created",
|
|
62
|
+
"description": "The date on which this item was created.",
|
|
63
|
+
"type": "DateTime",
|
|
64
|
+
"value": "javascript:return (new Date());",
|
|
65
|
+
"readonly": true
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"@id": "http://schema.org/validFrom",
|
|
69
|
+
"name": "validFrom",
|
|
70
|
+
"title": "validFrom",
|
|
71
|
+
"description": "The date when the item becomes valid.",
|
|
72
|
+
"type": "DateTime",
|
|
73
|
+
"nullable": false
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"@id": "http://schema.org/validThrough",
|
|
77
|
+
"name": "validThrough",
|
|
78
|
+
"title": "validThrough",
|
|
79
|
+
"description": "The date after when the item is not valid.",
|
|
80
|
+
"type": "DateTime",
|
|
81
|
+
"nullable": false
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"@id": "http://schema.org/cardStatus",
|
|
85
|
+
"name": "cardStatus",
|
|
86
|
+
"title": "cardStatus",
|
|
87
|
+
"description": "Indicates the current disposition of the Card.",
|
|
88
|
+
"type": "ActionStatusType",
|
|
89
|
+
"value": "javascript:return { alternateName:'PotentialActionStatus' };"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "dateCancelled",
|
|
93
|
+
"title": "Date Cancelled",
|
|
94
|
+
"description": "The date on which this item was cancelled.",
|
|
95
|
+
"type": "DateTime",
|
|
96
|
+
"nullable": true
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "cancelReason",
|
|
100
|
+
"title": "Λόγοι ακύρωσης",
|
|
101
|
+
"description": "Λόγοι ακύρωσης",
|
|
102
|
+
"type": "Text",
|
|
103
|
+
"size": 255,
|
|
104
|
+
"many": false,
|
|
105
|
+
"nullable": true
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "dateModified",
|
|
109
|
+
"title": "Ημερομηνία τροποποίησης",
|
|
110
|
+
"description": "Ημερομηνία τροποποίησης",
|
|
111
|
+
"type": "DateTime",
|
|
112
|
+
"nullable": false,
|
|
113
|
+
"value": "javascript:return new Date();",
|
|
114
|
+
"calculation": "javascript:return this.now();"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"constraints": [
|
|
118
|
+
{
|
|
119
|
+
"type": "unique",
|
|
120
|
+
"fields": [
|
|
121
|
+
"student",
|
|
122
|
+
"academicYear"
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"privileges": [
|
|
127
|
+
{
|
|
128
|
+
"mask": 31,
|
|
129
|
+
"type": "global"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"mask": 15,
|
|
133
|
+
"type": "global",
|
|
134
|
+
"account": "Administrators"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"mask": 1,
|
|
138
|
+
"type": "self",
|
|
139
|
+
"account": "Students",
|
|
140
|
+
"filter": "student/user eq me()"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"eventListeners": [
|
|
144
|
+
{
|
|
145
|
+
"type": "@themost/data/previous-state-listener"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"type": "./listeners/StudentAccommodationCardSaveListener"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"type": "./listeners/OnCancelAccommodationCardListener"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"type": "./listeners/SendEmailAfterCardStatusChangeListener"
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://themost-framework.github.io/themost/models/2018/2/schema.json",
|
|
3
|
+
"@id": "https://universis.io/schemas/TestAction",
|
|
4
|
+
"name": "TestAction",
|
|
5
|
+
"title": "TestActions",
|
|
6
|
+
"hidden": false,
|
|
7
|
+
"sealed": false,
|
|
8
|
+
"abstract": false,
|
|
9
|
+
"inherits": "StudentRequestAction",
|
|
10
|
+
"version": "1.0.0",
|
|
11
|
+
"fields": [
|
|
12
|
+
{
|
|
13
|
+
"name": "academicYear",
|
|
14
|
+
"type": "AcademicYear"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "academicPeriod",
|
|
18
|
+
"type": "AcademicPeriod"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"privileges": [
|
|
22
|
+
{
|
|
23
|
+
"mask": 15,
|
|
24
|
+
"type": "global"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"mask": 15,
|
|
28
|
+
"type": "global",
|
|
29
|
+
"account": "Administrators"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"mask": 15,
|
|
33
|
+
"type": "self",
|
|
34
|
+
"filter": "student eq student()",
|
|
35
|
+
"account": "Students"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"constraints": [
|
|
39
|
+
],
|
|
40
|
+
"seed": [
|
|
41
|
+
],
|
|
42
|
+
"eventListeners": [
|
|
43
|
+
{
|
|
44
|
+
"type": "@themost/data/previous-state-listener"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "./listeners/OnActionCompleteListener"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = [
|
|
2
|
+
{
|
|
3
|
+
"scope": [
|
|
4
|
+
"registrar"],
|
|
5
|
+
|
|
6
|
+
"resource": "/api/TestActions/?$",
|
|
7
|
+
"access": [
|
|
8
|
+
"read",
|
|
9
|
+
"write"]
|
|
10
|
+
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"scope": [
|
|
14
|
+
"registrar"],
|
|
15
|
+
|
|
16
|
+
"resource": "/api/Accommodations/?$",
|
|
17
|
+
"access": [
|
|
18
|
+
"read",
|
|
19
|
+
"write"]
|
|
20
|
+
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"scope": [
|
|
24
|
+
"registrar"],
|
|
25
|
+
|
|
26
|
+
"resource": "/api/AccommodationPlaces/?$",
|
|
27
|
+
"access": [
|
|
28
|
+
"read",
|
|
29
|
+
"write"]
|
|
30
|
+
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"scope": [
|
|
34
|
+
"students"],
|
|
35
|
+
|
|
36
|
+
"resource": "/api/TestActions/?$",
|
|
37
|
+
"access": [
|
|
38
|
+
"read",
|
|
39
|
+
"write"]
|
|
40
|
+
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"scope": [
|
|
44
|
+
"students"],
|
|
45
|
+
|
|
46
|
+
"resource": "/api/Accommodations/?$",
|
|
47
|
+
"access": [
|
|
48
|
+
"read"]
|
|
49
|
+
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"scope": [
|
|
53
|
+
"students"],
|
|
54
|
+
|
|
55
|
+
"resource": "/api/AccommodationRequestActions",
|
|
56
|
+
"access": [
|
|
57
|
+
"read",
|
|
58
|
+
"write"]
|
|
59
|
+
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"scope": [
|
|
63
|
+
"students"],
|
|
64
|
+
|
|
65
|
+
"resource": "/api/AccommodationRequestEvents",
|
|
66
|
+
"access": [
|
|
67
|
+
"read"]
|
|
68
|
+
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"scope": [
|
|
72
|
+
"students"],
|
|
73
|
+
|
|
74
|
+
"resource": "/api/AccommodationRequestCategories",
|
|
75
|
+
"access": [
|
|
76
|
+
"read"]
|
|
77
|
+
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"scope": [
|
|
81
|
+
"students"],
|
|
82
|
+
|
|
83
|
+
"resource": "/api/StudentAccommodationCards",
|
|
84
|
+
"access": [
|
|
85
|
+
"read"]
|
|
86
|
+
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"scope": [
|
|
90
|
+
"registrar"],
|
|
91
|
+
|
|
92
|
+
"resource": "/api/AccommodationRequestActions",
|
|
93
|
+
"access": [
|
|
94
|
+
"read",
|
|
95
|
+
"write"]
|
|
96
|
+
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"scope": [
|
|
100
|
+
"registrar"],
|
|
101
|
+
|
|
102
|
+
"resource": "/api/AccommodationRequestEvents",
|
|
103
|
+
"access": [
|
|
104
|
+
"read",
|
|
105
|
+
"write"]
|
|
106
|
+
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"scope": [
|
|
110
|
+
"registrar"],
|
|
111
|
+
|
|
112
|
+
"resource": "/api/AccommodationRequestEffectiveStatusTypes",
|
|
113
|
+
"access": [
|
|
114
|
+
"read",
|
|
115
|
+
"write"]
|
|
116
|
+
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"scope": [
|
|
120
|
+
"registrar"],
|
|
121
|
+
|
|
122
|
+
"resource": "/api/AccommodationCardEffectiveStatusTypes",
|
|
123
|
+
"access": [
|
|
124
|
+
"read",
|
|
125
|
+
"write"]
|
|
126
|
+
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"scope": [
|
|
130
|
+
"registrar"],
|
|
131
|
+
|
|
132
|
+
"resource": "/api/AccommodationRequestCategories",
|
|
133
|
+
"access": [
|
|
134
|
+
"read",
|
|
135
|
+
"write"]
|
|
136
|
+
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"scope": [
|
|
140
|
+
"registrar"],
|
|
141
|
+
|
|
142
|
+
"resource": "/api/StudentAccommodationCards/?$",
|
|
143
|
+
"access": [
|
|
144
|
+
"read",
|
|
145
|
+
"write"]
|
|
146
|
+
|
|
147
|
+
}];exports.default = _default;
|
|
148
|
+
//# sourceMappingURL=scope.access.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.access.js","names":["exports","default","_default"],"sources":["../../src/config/scope.access.js"],"sourcesContent":["export default [\n {\n \"scope\": [\n \"registrar\"\n ],\n \"resource\": \"/api/TestActions/?$\",\n \"access\": [\n \"read\",\n \"write\"\n ]\n },\n {\n \"scope\": [\n \"registrar\"\n ],\n \"resource\": \"/api/Accommodations/?$\",\n \"access\": [\n \"read\",\n \"write\"\n ]\n },\n {\n \"scope\": [\n \"registrar\"\n ],\n \"resource\": \"/api/AccommodationPlaces/?$\",\n \"access\": [\n \"read\",\n \"write\"\n ]\n },\n {\n \"scope\": [\n \"students\"\n ],\n \"resource\": \"/api/TestActions/?$\",\n \"access\": [\n \"read\",\n \"write\"\n ]\n },\n {\n \"scope\": [\n \"students\"\n ],\n \"resource\": \"/api/Accommodations/?$\",\n \"access\": [\n \"read\"\n ]\n },\n {\n \"scope\": [\n \"students\"\n ],\n \"resource\": \"/api/AccommodationRequestActions\",\n \"access\": [\n \"read\",\n \"write\"\n ]\n },\n {\n \"scope\": [\n \"students\"\n ],\n \"resource\": \"/api/AccommodationRequestEvents\",\n \"access\": [\n \"read\"\n ]\n },\n {\n \"scope\": [\n \"students\"\n ],\n \"resource\": \"/api/AccommodationRequestCategories\",\n \"access\": [\n \"read\"\n ]\n },\n {\n \"scope\": [\n \"students\"\n ],\n \"resource\": \"/api/StudentAccommodationCards\",\n \"access\": [\n \"read\"\n ]\n },\n {\n \"scope\": [\n \"registrar\"\n ],\n \"resource\": \"/api/AccommodationRequestActions\",\n \"access\": [\n \"read\",\n \"write\"\n ]\n },\n {\n \"scope\": [\n \"registrar\"\n ],\n \"resource\": \"/api/AccommodationRequestEvents\",\n \"access\": [\n \"read\",\n \"write\"\n ]\n },\n {\n \"scope\": [\n \"registrar\"\n ],\n \"resource\": \"/api/AccommodationRequestEffectiveStatusTypes\",\n \"access\": [\n \"read\",\n \"write\"\n ]\n },\n {\n \"scope\": [\n \"registrar\"\n ],\n \"resource\": \"/api/AccommodationCardEffectiveStatusTypes\",\n \"access\": [\n \"read\",\n \"write\"\n ]\n },\n {\n \"scope\": [\n \"registrar\"\n ],\n \"resource\": \"/api/AccommodationRequestCategories\",\n \"access\": [\n \"read\",\n \"write\"\n ]\n },\n {\n \"scope\": [\n \"registrar\"\n ],\n \"resource\": \"/api/StudentAccommodationCards/?$\",\n \"access\": [\n \"read\",\n \"write\"\n ]\n }\n]\n"],"mappings":"mHAAe;AACX;EACI,OAAO,EAAE;EACL,WAAW,CACd;;EACD,UAAU,EAAE,qBAAqB;EACjC,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC;AACD;EACI,OAAO,EAAE;EACL,WAAW,CACd;;EACD,UAAU,EAAE,wBAAwB;EACpC,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC;AACD;EACI,OAAO,EAAE;EACL,WAAW,CACd;;EACD,UAAU,EAAE,6BAA6B;EACzC,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC;AACD;EACI,OAAO,EAAE;EACL,UAAU,CACb;;EACD,UAAU,EAAE,qBAAqB;EACjC,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC;AACD;EACI,OAAO,EAAE;EACL,UAAU,CACb;;EACD,UAAU,EAAE,wBAAwB;EACpC,QAAQ,EAAE;EACN,MAAM;;AAEd,CAAC;AACD;EACI,OAAO,EAAE;EACL,UAAU,CACb;;EACD,UAAU,EAAE,kCAAkC;EAC9C,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC;AACD;EACI,OAAO,EAAE;EACL,UAAU,CACb;;EACD,UAAU,EAAE,iCAAiC;EAC7C,QAAQ,EAAE;EACN,MAAM;;AAEd,CAAC;AACD;EACI,OAAO,EAAE;EACL,UAAU,CACb;;EACD,UAAU,EAAE,qCAAqC;EACjD,QAAQ,EAAE;EACN,MAAM;;AAEd,CAAC;AACD;EACI,OAAO,EAAE;EACL,UAAU,CACb;;EACD,UAAU,EAAE,gCAAgC;EAC5C,QAAQ,EAAE;EACN,MAAM;;AAEd,CAAC;AACD;EACI,OAAO,EAAE;EACL,WAAW,CACd;;EACD,UAAU,EAAE,kCAAkC;EAC9C,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC;AACD;EACI,OAAO,EAAE;EACL,WAAW,CACd;;EACD,UAAU,EAAE,iCAAiC;EAC7C,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC;AACD;EACI,OAAO,EAAE;EACL,WAAW,CACd;;EACD,UAAU,EAAE,+CAA+C;EAC3D,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC;AACD;EACI,OAAO,EAAE;EACL,WAAW,CACd;;EACD,UAAU,EAAE,4CAA4C;EACxD,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC;AACD;EACI,OAAO,EAAE;EACL,WAAW,CACd;;EACD,UAAU,EAAE,qCAAqC;EACjD,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC;AACD;EACI,OAAO,EAAE;EACL,WAAW,CACd;;EACD,UAAU,EAAE,mCAAmC;EAC/C,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC,CACJ,CAAAA,OAAA,CAAAC,OAAA,GAAAC,QAAA"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });var _AccommodationSchemaLoader = require("./AccommodationSchemaLoader");Object.keys(_AccommodationSchemaLoader).forEach(function (key) {if (key === "default" || key === "__esModule") return;if (key in exports && exports[key] === _AccommodationSchemaLoader[key]) return;Object.defineProperty(exports, key, { enumerable: true, get: function () {return _AccommodationSchemaLoader[key];} });});
|
|
2
|
+
var _AccommodationService = require("./AccommodationService");Object.keys(_AccommodationService).forEach(function (key) {if (key === "default" || key === "__esModule") return;if (key in exports && exports[key] === _AccommodationService[key]) return;Object.defineProperty(exports, key, { enumerable: true, get: function () {return _AccommodationService[key];} });});
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_AccommodationSchemaLoader","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_AccommodationService"],"sources":["../src/index.js"],"sourcesContent":["export * from './AccommodationSchemaLoader';\nexport * from './AccommodationService';"],"mappings":"2EAAA,IAAAA,0BAAA,GAAAC,OAAA,gCAAAC,MAAA,CAAAC,IAAA,CAAAH,0BAAA,EAAAI,OAAA,WAAAC,GAAA,OAAAA,GAAA,kBAAAA,GAAA,8BAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,0BAAA,CAAAK,GAAA,UAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA,IAAAG,UAAA,QAAAC,GAAA,WAAAA,CAAA,UAAAT,0BAAA,CAAAK,GAAA;AACA,IAAAK,qBAAA,GAAAT,OAAA,2BAAAC,MAAA,CAAAC,IAAA,CAAAO,qBAAA,EAAAN,OAAA,WAAAC,GAAA,OAAAA,GAAA,kBAAAA,GAAA,8BAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,qBAAA,CAAAL,GAAA,UAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA,IAAAG,UAAA,QAAAC,GAAA,WAAAA,CAAA,UAAAC,qBAAA,CAAAL,GAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.afterSave = afterSave;exports.beforeSave = beforeSave;var _data = require("@themost/data");
|
|
2
|
+
const DefaultAttachmentConfigurations = require('./DefaultAttachmentConfigurations.json');
|
|
3
|
+
const DefaultAttachmentTypes = require('./DefaultAttachmentTypes.json');
|
|
4
|
+
// eslint-disable-next-line no-unused-vars
|
|
5
|
+
async function beforeSaveAsync(event) {
|
|
6
|
+
if (event.state !== _data.DataObjectState.Insert) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const context = event.model.context;
|
|
10
|
+
if (event.target.attachmentTypes == null) {
|
|
11
|
+
// force add attachment types even if they are already defined
|
|
12
|
+
await context.model('AttachmentType').silent().save(DefaultAttachmentTypes);
|
|
13
|
+
event.target.attachmentTypes = DefaultAttachmentConfigurations;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function afterSaveAsync(event) {
|
|
18
|
+
|
|
19
|
+
//
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @param {DataEventArgs} event
|
|
23
|
+
* @param {Function} callback
|
|
24
|
+
*/
|
|
25
|
+
function beforeSave(event, callback) {
|
|
26
|
+
return beforeSaveAsync(event).then(() => {
|
|
27
|
+
return callback();
|
|
28
|
+
}).catch((err) => {
|
|
29
|
+
return callback(err);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param {DataEventArgs} event
|
|
35
|
+
* @param {Function} callback
|
|
36
|
+
*/
|
|
37
|
+
function afterSave(event, callback) {
|
|
38
|
+
return afterSaveAsync(event).then(() => {
|
|
39
|
+
return callback();
|
|
40
|
+
}).catch((err) => {
|
|
41
|
+
return callback(err);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=AddDefaultAttachmentConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddDefaultAttachmentConfiguration.js","names":["_data","require","DefaultAttachmentConfigurations","DefaultAttachmentTypes","beforeSaveAsync","event","state","DataObjectState","Insert","context","model","target","attachmentTypes","silent","save","afterSaveAsync","beforeSave","callback","then","catch","err","afterSave"],"sources":["../../src/listeners/AddDefaultAttachmentConfiguration.js"],"sourcesContent":["import {DataObjectState} from '@themost/data';\nconst DefaultAttachmentConfigurations = require('./DefaultAttachmentConfigurations.json');\nconst DefaultAttachmentTypes = require('./DefaultAttachmentTypes.json');\n// eslint-disable-next-line no-unused-vars\nasync function beforeSaveAsync(event) {\n if (event.state !== DataObjectState.Insert) {\n return;\n }\n const context = event.model.context;\n if (event.target.attachmentTypes == null) {\n // force add attachment types even if they are already defined\n await context.model('AttachmentType').silent().save(DefaultAttachmentTypes);\n event.target.attachmentTypes = DefaultAttachmentConfigurations;\n }\n}\n\nasync function afterSaveAsync(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}"],"mappings":"yIAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,MAAMC,+BAA+B,GAAGD,OAAO,CAAC,wCAAwC,CAAC;AACzF,MAAME,sBAAsB,GAAGF,OAAO,CAAC,+BAA+B,CAAC;AACvE;AACA,eAAeG,eAAeA,CAACC,KAAK,EAAE;EAClC,IAAIA,KAAK,CAACC,KAAK,KAAKC,qBAAe,CAACC,MAAM,EAAE;IACxC;EACJ;EACA,MAAMC,OAAO,GAAGJ,KAAK,CAACK,KAAK,CAACD,OAAO;EACnC,IAAIJ,KAAK,CAACM,MAAM,CAACC,eAAe,IAAI,IAAI,EAAE;IACtC;IACA,MAAMH,OAAO,CAACC,KAAK,CAAC,gBAAgB,CAAC,CAACG,MAAM,EAAE,CAACC,IAAI,CAACX,sBAAsB,CAAC;IAC3EE,KAAK,CAACM,MAAM,CAACC,eAAe,GAAGV,+BAA+B;EAClE;AACJ;;AAEA,eAAea,cAAcA,CAACV,KAAK,EAAE;;EACjC;AAAA;AAGJ;AACA;AACA;AACA;AACO,SAASW,UAAUA,CAACX,KAAK,EAAEY,QAAQ,EAAE;EACxC,OAAOb,eAAe,CAACC,KAAK,CAAC,CAACa,IAAI,CAAC,MAAM;IACrC,OAAOD,QAAQ,EAAE;EACrB,CAAC,CAAC,CAACE,KAAK,CAAC,CAACC,GAAG,KAAK;IACd,OAAOH,QAAQ,CAACG,GAAG,CAAC;EACxB,CAAC,CAAC;AACN;;AAEA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAChB,KAAK,EAAEY,QAAQ,EAAE;EACvC,OAAOF,cAAc,CAACV,KAAK,CAAC,CAACa,IAAI,CAAC,MAAM;IACpC,OAAOD,QAAQ,EAAE;EACrB,CAAC,CAAC,CAACE,KAAK,CAAC,CAACC,GAAG,KAAK;IACd,OAAOH,QAAQ,CAACG,GAAG,CAAC;EACxB,CAAC,CAAC;AACN"}
|