@plusscommunities/pluss-maintenance-aws-forms 2.1.45 → 2.1.47

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.
Files changed (44) hide show
  1. package/createJob.js +207 -114
  2. package/createJobType.js +49 -49
  3. package/db/maintenance/addMaintenanceJob.js +100 -90
  4. package/db/maintenance/editMaintenanceJob.js +22 -12
  5. package/db/maintenance/getJobEmail.js +22 -22
  6. package/deleteJob.js +58 -58
  7. package/deleteJobType.js +40 -40
  8. package/editJob.js +137 -65
  9. package/editJobStatus.js +57 -57
  10. package/editJobType.js +61 -61
  11. package/editNote.js +117 -117
  12. package/feature.config.js +283 -270
  13. package/getData.js +48 -41
  14. package/getJob.js +4 -4
  15. package/getJobType.js +35 -35
  16. package/getJobTypes.js +66 -66
  17. package/getJobs.js +48 -48
  18. package/integration/IntegrationStrategy.js +52 -52
  19. package/integration/archibus/ArchibusStrategy.js +42 -28
  20. package/integration/index.js +19 -19
  21. package/jobChanged.js +88 -89
  22. package/jobTypesChanged.js +52 -39
  23. package/package.json +3 -3
  24. package/requests/assignRequest.js +81 -81
  25. package/requests/getAssignees.js +27 -27
  26. package/requests/getExternalSync.js +100 -100
  27. package/requests/getPropertyRequests.js +89 -0
  28. package/requests/getRequest.js +77 -77
  29. package/requests/helper/hasRequestPermission.js +12 -12
  30. package/requests/helper/isValidAssignee.js +10 -10
  31. package/requests/retrySync.js +90 -90
  32. package/requests/setExternalJobId.js +113 -113
  33. package/requests/updatePriority.js +33 -33
  34. package/scheduleJobImport.js +63 -63
  35. package/sendJobEmail.js +105 -104
  36. package/updateData.js +34 -34
  37. package/values.config.a.js +26 -25
  38. package/values.config.default.js +30 -28
  39. package/values.config.enquiry.js +222 -221
  40. package/values.config.feedback.js +194 -193
  41. package/values.config.food.js +29 -28
  42. package/values.config.forms.js +29 -28
  43. package/values.config.js +29 -28
  44. package/watchJobs.js +154 -154
package/feature.config.js CHANGED
@@ -1,280 +1,293 @@
1
1
  const { values } = require("./values.config");
2
2
 
3
3
  exports.permissions = [
4
- values.permissionMaintenanceTracking,
5
- values.permissionMaintenanceAssignment,
6
- values.permissionMaintenanceTypes,
4
+ values.permissionMaintenanceTracking,
5
+ values.permissionMaintenanceAssignment,
6
+ values.permissionMaintenanceTypes,
7
7
  ];
8
8
 
9
9
  exports.entity = {
10
- key: values.entityKey,
11
- permission: values.permissionMaintenanceTracking,
12
- table: values.tableNameMaintenance,
13
- id: "id",
14
- webPath: values.routeEntityPath,
15
- appPath: values.screenMaintenanceDetail,
10
+ key: values.entityKey,
11
+ permission: values.permissionMaintenanceTracking,
12
+ table: values.tableNameMaintenance,
13
+ id: "id",
14
+ webPath: values.routeEntityPath,
15
+ appPath: values.screenMaintenanceDetail,
16
16
  };
17
17
 
18
18
  exports.serverless = {
19
- name: values.serviceKey,
20
- useVpc: true, // Enable VPC routing for static outbound IP (requires vpcConfig in config/index.js)
21
- apis: [
22
- {
23
- name: "getJobType",
24
- file: "getJobType",
25
- function: "getJobType",
26
- memorySize: 256,
27
- timeout: 30,
28
- path: "getjobtype",
29
- method: "post",
30
- },
31
- {
32
- name: "getJobTypes",
33
- file: "getJobTypes",
34
- function: "getJobTypes",
35
- memorySize: 256,
36
- timeout: 30,
37
- path: "getjobtypes",
38
- method: "post",
39
- },
40
- {
41
- name: "createJobType",
42
- file: "createJobType",
43
- function: "createJobType",
44
- memorySize: 256,
45
- timeout: 30,
46
- path: "createJobType",
47
- method: "post",
48
- },
49
- {
50
- name: "editJobType",
51
- file: "editJobType",
52
- function: "editJobType",
53
- memorySize: 256,
54
- timeout: 30,
55
- path: "editJobType",
56
- method: "post",
57
- },
58
- {
59
- name: "deleteJobType",
60
- file: "deleteJobType",
61
- function: "deleteJobType",
62
- memorySize: 256,
63
- timeout: 30,
64
- path: "deleteJobType",
65
- method: "post",
66
- },
67
- {
68
- name: "getJob",
69
- file: "getJob",
70
- function: "getJob",
71
- memorySize: 256,
72
- timeout: 30,
73
- path: "getJob",
74
- method: "post",
75
- },
76
- {
77
- name: "getJobs",
78
- file: "getJobs",
79
- function: "getJobs",
80
- memorySize: 256,
81
- timeout: 30,
82
- path: "getJobs",
83
- method: "post",
84
- },
85
- {
86
- name: "createJob",
87
- file: "createJob",
88
- function: "createJob",
89
- memorySize: 256,
90
- timeout: 30,
91
- path: "sendMaintenance",
92
- method: "post",
93
- },
94
- {
95
- name: "editJob",
96
- file: "editJob",
97
- function: "editJob",
98
- memorySize: 256,
99
- timeout: 30,
100
- path: "editJob",
101
- method: "post",
102
- },
103
- {
104
- name: "deleteJob",
105
- file: "deleteJob",
106
- function: "deleteJob",
107
- memorySize: 256,
108
- timeout: 30,
109
- path: "requests/remove",
110
- method: "post",
111
- },
112
- {
113
- name: "editJobStatus",
114
- file: "editJobStatus",
115
- function: "editJobStatus",
116
- memorySize: 256,
117
- timeout: 30,
118
- path: "editJobStatus",
119
- method: "post",
120
- },
121
- {
122
- name: "editNote",
123
- file: "editNote",
124
- function: "editNote",
125
- memorySize: 256,
126
- timeout: 30,
127
- path: "requests/note",
128
- method: "post",
129
- },
130
- {
131
- name: "getData",
132
- file: "getData",
133
- function: "getData",
134
- memorySize: 256,
135
- timeout: 30,
136
- path: "get/{action}",
137
- method: "get",
138
- },
139
- {
140
- name: "updateData",
141
- file: "updateData",
142
- function: "updateData",
143
- memorySize: 256,
144
- timeout: 30,
145
- path: "update/{action}",
146
- method: "post",
147
- },
148
- ],
149
- triggers: [
150
- {
151
- name: "jobChanged",
152
- file: "jobChanged",
153
- function: "jobChanged",
154
- memorySize: 2048,
155
- timeout: 300,
156
- table: values.tableKeyMaintenance,
157
- },
158
- {
159
- name: "jobTypesChanged",
160
- file: "jobTypesChanged",
161
- function: "jobTypesChanged",
162
- memorySize: 512,
163
- timeout: 60,
164
- table: values.tableKeyJobTypes,
165
- },
166
- ],
167
- schedules: [
168
- {
169
- name: "watchJobs",
170
- file: "watchJobs",
171
- function: "watchJobs",
172
- memorySize: "2048",
173
- timeout: "300",
174
- rate: "1/5 * * * ? *",
175
- },
176
- {
177
- name: "scheduleJobImport",
178
- file: "scheduleJobImport",
179
- function: "scheduleJobImport",
180
- memorySize: "2048",
181
- timeout: "300",
182
- rate: "2/3 * * * ? *",
183
- },
184
- ],
185
- tables: [
186
- {
187
- key: values.tableKeyJobTypes,
188
- name: values.tableNameJobTypes,
189
- attributes: [
190
- { name: "id", type: "S" },
191
- { name: "site", type: "S" },
192
- { name: "typeName", type: "S" },
193
- ],
194
- id: "id",
195
- indexes: [
196
- {
197
- name: "JobTypeSiteIndex",
198
- keys: [
199
- { name: "site", type: "HASH" },
200
- { name: "typeName", type: "RANGE" },
201
- ],
202
- },
203
- ],
204
- },
205
- {
206
- key: values.tableKeyMaintenance,
207
- name: values.tableNameMaintenance,
208
- attributes: [
209
- { name: "id", type: "S" },
210
- { name: "site", type: "S" },
211
- { name: "jobId", type: "S" },
212
- { name: "jobNo", type: "N" },
213
- { name: "userID", type: "S" },
214
- { name: "AssigneeId", type: "S" },
215
- { name: "status", type: "S" },
216
- ],
217
- id: "id",
218
- indexes: [
219
- {
220
- name: "MaintenanceSiteIndex",
221
- keys: [{ name: "site", type: "HASH" }],
222
- },
223
- {
224
- name: "MaintenanceSiteJobIdIndex",
225
- keys: [
226
- { name: "site", type: "HASH" },
227
- { name: "jobId", type: "RANGE" },
228
- ],
229
- },
230
- {
231
- name: "MaintenanceSiteJobNoIndex",
232
- keys: [
233
- { name: "site", type: "HASH" },
234
- { name: "jobNo", type: "RANGE" },
235
- ],
236
- },
237
- {
238
- name: "MaintenanceSiteUserIdIndex",
239
- keys: [
240
- { name: "site", type: "HASH" },
241
- { name: "userID", type: "RANGE" },
242
- ],
243
- },
244
- {
245
- name: "MaintenanceSiteAssigneeIndex",
246
- keys: [
247
- { name: "site", type: "HASH" },
248
- { name: "AssigneeId", type: "RANGE" },
249
- ],
250
- },
251
- {
252
- name: "MaintenanceSiteStatusIndex",
253
- keys: [
254
- { name: "site", type: "HASH" },
255
- { name: "status", type: "RANGE" },
256
- ],
257
- },
258
- ],
259
- },
260
- {
261
- key: values.tableKeySupportTickets,
262
- name: values.tableNameSupportTickets,
263
- attributes: [
264
- { name: "Id", type: "S" },
265
- { name: "Site", type: "S" },
266
- { name: "Status", type: "S" },
267
- ],
268
- id: "Id",
269
- indexes: [
270
- {
271
- name: "TicketsSiteStatusIndex",
272
- keys: [
273
- { name: "Site", type: "HASH" },
274
- { name: "Status", type: "RANGE" },
275
- ],
276
- },
277
- ],
278
- },
279
- ],
19
+ name: values.serviceKey,
20
+ useVpc: true, // Enable VPC routing for static outbound IP (requires vpcConfig in config/index.js)
21
+ // Aurora app secret is only used for property resolution, so only the
22
+ // property-linking variant asks for it — clone variants (forms/enquiry/
23
+ // feedback) stay off Aurora entirely. gs also skips this wiring in
24
+ // environments without the database stack (config/index.js postgresEnabled).
25
+ usePostgres: values.linkToProperty === true, // requires useVpc
26
+ apis: [
27
+ {
28
+ name: "getJobType",
29
+ file: "getJobType",
30
+ function: "getJobType",
31
+ memorySize: 256,
32
+ timeout: 30,
33
+ path: "getjobtype",
34
+ method: "post",
35
+ },
36
+ {
37
+ name: "getJobTypes",
38
+ file: "getJobTypes",
39
+ function: "getJobTypes",
40
+ memorySize: 256,
41
+ timeout: 30,
42
+ path: "getjobtypes",
43
+ method: "post",
44
+ },
45
+ {
46
+ name: "createJobType",
47
+ file: "createJobType",
48
+ function: "createJobType",
49
+ memorySize: 256,
50
+ timeout: 30,
51
+ path: "createJobType",
52
+ method: "post",
53
+ },
54
+ {
55
+ name: "editJobType",
56
+ file: "editJobType",
57
+ function: "editJobType",
58
+ memorySize: 256,
59
+ timeout: 30,
60
+ path: "editJobType",
61
+ method: "post",
62
+ },
63
+ {
64
+ name: "deleteJobType",
65
+ file: "deleteJobType",
66
+ function: "deleteJobType",
67
+ memorySize: 256,
68
+ timeout: 30,
69
+ path: "deleteJobType",
70
+ method: "post",
71
+ },
72
+ {
73
+ name: "getJob",
74
+ file: "getJob",
75
+ function: "getJob",
76
+ memorySize: 256,
77
+ timeout: 30,
78
+ path: "getJob",
79
+ method: "post",
80
+ },
81
+ {
82
+ name: "getJobs",
83
+ file: "getJobs",
84
+ function: "getJobs",
85
+ memorySize: 256,
86
+ timeout: 30,
87
+ path: "getJobs",
88
+ method: "post",
89
+ },
90
+ {
91
+ name: "createJob",
92
+ file: "createJob",
93
+ function: "createJob",
94
+ memorySize: 256,
95
+ timeout: 30,
96
+ path: "sendMaintenance",
97
+ method: "post",
98
+ },
99
+ {
100
+ name: "editJob",
101
+ file: "editJob",
102
+ function: "editJob",
103
+ memorySize: 256,
104
+ timeout: 30,
105
+ path: "editJob",
106
+ method: "post",
107
+ },
108
+ {
109
+ name: "deleteJob",
110
+ file: "deleteJob",
111
+ function: "deleteJob",
112
+ memorySize: 256,
113
+ timeout: 30,
114
+ path: "requests/remove",
115
+ method: "post",
116
+ },
117
+ {
118
+ name: "editJobStatus",
119
+ file: "editJobStatus",
120
+ function: "editJobStatus",
121
+ memorySize: 256,
122
+ timeout: 30,
123
+ path: "editJobStatus",
124
+ method: "post",
125
+ },
126
+ {
127
+ name: "editNote",
128
+ file: "editNote",
129
+ function: "editNote",
130
+ memorySize: 256,
131
+ timeout: 30,
132
+ path: "requests/note",
133
+ method: "post",
134
+ },
135
+ {
136
+ name: "getData",
137
+ file: "getData",
138
+ function: "getData",
139
+ memorySize: 256,
140
+ timeout: 30,
141
+ path: "get/{action}",
142
+ method: "get",
143
+ },
144
+ {
145
+ name: "updateData",
146
+ file: "updateData",
147
+ function: "updateData",
148
+ memorySize: 256,
149
+ timeout: 30,
150
+ path: "update/{action}",
151
+ method: "post",
152
+ },
153
+ ],
154
+ triggers: [
155
+ {
156
+ name: "jobChanged",
157
+ file: "jobChanged",
158
+ function: "jobChanged",
159
+ memorySize: 2048,
160
+ timeout: 300,
161
+ table: values.tableKeyMaintenance,
162
+ },
163
+ {
164
+ name: "jobTypesChanged",
165
+ file: "jobTypesChanged",
166
+ function: "jobTypesChanged",
167
+ memorySize: 512,
168
+ timeout: 60,
169
+ table: values.tableKeyJobTypes,
170
+ },
171
+ ],
172
+ schedules: [
173
+ {
174
+ name: "watchJobs",
175
+ file: "watchJobs",
176
+ function: "watchJobs",
177
+ memorySize: "2048",
178
+ timeout: "300",
179
+ rate: "1/5 * * * ? *",
180
+ },
181
+ {
182
+ name: "scheduleJobImport",
183
+ file: "scheduleJobImport",
184
+ function: "scheduleJobImport",
185
+ memorySize: "2048",
186
+ timeout: "300",
187
+ rate: "2/3 * * * ? *",
188
+ },
189
+ ],
190
+ tables: [
191
+ {
192
+ key: values.tableKeyJobTypes,
193
+ name: values.tableNameJobTypes,
194
+ attributes: [
195
+ { name: "id", type: "S" },
196
+ { name: "site", type: "S" },
197
+ { name: "typeName", type: "S" },
198
+ ],
199
+ id: "id",
200
+ indexes: [
201
+ {
202
+ name: "JobTypeSiteIndex",
203
+ keys: [
204
+ { name: "site", type: "HASH" },
205
+ { name: "typeName", type: "RANGE" },
206
+ ],
207
+ },
208
+ ],
209
+ },
210
+ {
211
+ key: values.tableKeyMaintenance,
212
+ name: values.tableNameMaintenance,
213
+ attributes: [
214
+ { name: "id", type: "S" },
215
+ { name: "site", type: "S" },
216
+ { name: "jobId", type: "S" },
217
+ { name: "jobNo", type: "N" },
218
+ { name: "userID", type: "S" },
219
+ { name: "AssigneeId", type: "S" },
220
+ { name: "status", type: "S" },
221
+ // Set only on property-linked requests (sparse index key).
222
+ { name: "propertyId", type: "S" },
223
+ ],
224
+ id: "id",
225
+ indexes: [
226
+ {
227
+ name: "MaintenanceSiteIndex",
228
+ keys: [{ name: "site", type: "HASH" }],
229
+ },
230
+ // Declared to match the table deployed from newer published releases —
231
+ // omitting them would make CloudFormation delete live indexes.
232
+ {
233
+ name: "MaintenanceSiteAssigneeIndex",
234
+ keys: [
235
+ { name: "site", type: "HASH" },
236
+ { name: "AssigneeId", type: "RANGE" },
237
+ ],
238
+ },
239
+ {
240
+ name: "MaintenanceSiteStatusIndex",
241
+ keys: [
242
+ { name: "site", type: "HASH" },
243
+ { name: "status", type: "RANGE" },
244
+ ],
245
+ },
246
+ {
247
+ name: "MaintenanceSiteJobIdIndex",
248
+ keys: [
249
+ { name: "site", type: "HASH" },
250
+ { name: "jobId", type: "RANGE" },
251
+ ],
252
+ },
253
+ {
254
+ name: "MaintenanceSiteJobNoIndex",
255
+ keys: [
256
+ { name: "site", type: "HASH" },
257
+ { name: "jobNo", type: "RANGE" },
258
+ ],
259
+ },
260
+ {
261
+ name: "MaintenanceSiteUserIdIndex",
262
+ keys: [
263
+ { name: "site", type: "HASH" },
264
+ { name: "userID", type: "RANGE" },
265
+ ],
266
+ },
267
+ {
268
+ name: "MaintenancePropertyIdIndex",
269
+ keys: [{ name: "propertyId", type: "HASH" }],
270
+ },
271
+ ],
272
+ },
273
+ {
274
+ key: values.tableKeySupportTickets,
275
+ name: values.tableNameSupportTickets,
276
+ attributes: [
277
+ { name: "Id", type: "S" },
278
+ { name: "Site", type: "S" },
279
+ { name: "Status", type: "S" },
280
+ ],
281
+ id: "Id",
282
+ indexes: [
283
+ {
284
+ name: "TicketsSiteStatusIndex",
285
+ keys: [
286
+ { name: "Site", type: "HASH" },
287
+ { name: "Status", type: "RANGE" },
288
+ ],
289
+ },
290
+ ],
291
+ },
292
+ ],
280
293
  };