ember-ebau-gwr 3.1.1 → 3.2.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/CHANGELOG.md +24 -0
- package/addon/components/back-route.hbs +10 -0
- package/addon/components/linked-models.hbs +11 -5
- package/addon/components/model-errors/error-indicator.hbs +3 -1
- package/addon/components/model-errors/header.hbs +4 -2
- package/addon/components/model-errors.hbs +1 -0
- package/addon/components/model-form/field.js +5 -2
- package/addon/components/model-form/header/actions.hbs +5 -3
- package/addon/components/model-form.js +9 -1
- package/addon/components/model-inview.hbs +8 -0
- package/addon/components/model-inview.js +12 -0
- package/addon/components/sub-nav.hbs +5 -10
- package/addon/controllers/building/edit/dwelling/edit.js +2 -2
- package/addon/controllers/building/edit/form.js +0 -5
- package/addon/controllers/project/errors.js +25 -29
- package/addon/controllers/project/form.js +25 -5
- package/addon/controllers/project.js +1 -1
- package/addon/helpers/housing-stat-link.js +13 -0
- package/addon/helpers/show-model-field.js +13 -0
- package/addon/models/building.js +1 -1
- package/addon/models/construction-project.js +1 -1
- package/addon/models/options.js +251 -1
- package/addon/services/building.js +182 -192
- package/addon/services/construction-project.js +134 -145
- package/addon/services/gwr.js +4 -0
- package/addon/templates/building/edit/dwelling/edit.hbs +25 -22
- package/addon/templates/building/edit/entrance/edit/index.hbs +1 -2
- package/addon/templates/building/edit/form.hbs +38 -16
- package/addon/templates/project/errors.hbs +121 -132
- package/addon/templates/project/form.hbs +87 -53
- package/addon/templates/project/linked-buildings.hbs +13 -20
- package/addon/templates/project.hbs +23 -17
- package/addon/templates/search-building.hbs +6 -0
- package/addon/templates/search-project.hbs +6 -0
- package/addon/utils.js +8 -0
- package/addon/validations/building-work.js +2 -0
- package/addon/validations/dwelling.js +0 -5
- package/app/styles/ember-ebau-gwr.scss +8 -0
- package/config/environment.js +3 -0
- package/package.json +1 -1
- package/translations/building/de.yaml +3 -5
- package/translations/construction-project/de.yaml +256 -4
- package/translations/de.yaml +21 -3
- package/translations/dwelling/de.yaml +3 -1
package/addon/models/options.js
CHANGED
|
@@ -116,7 +116,257 @@ export const projectStatusOptions = [
|
|
|
116
116
|
6709,
|
|
117
117
|
];
|
|
118
118
|
|
|
119
|
-
export const countryOptions = [
|
|
119
|
+
export const countryOptions = [
|
|
120
|
+
"af",
|
|
121
|
+
"eg",
|
|
122
|
+
"ax",
|
|
123
|
+
"al",
|
|
124
|
+
"dz",
|
|
125
|
+
"as",
|
|
126
|
+
"ad",
|
|
127
|
+
"ao",
|
|
128
|
+
"ai",
|
|
129
|
+
"aq",
|
|
130
|
+
"ag",
|
|
131
|
+
"gq",
|
|
132
|
+
"ar",
|
|
133
|
+
"am",
|
|
134
|
+
"aw",
|
|
135
|
+
"az",
|
|
136
|
+
"et",
|
|
137
|
+
"au",
|
|
138
|
+
"bs",
|
|
139
|
+
"bh",
|
|
140
|
+
"bd",
|
|
141
|
+
"bb",
|
|
142
|
+
"by",
|
|
143
|
+
"be",
|
|
144
|
+
"bz",
|
|
145
|
+
"bj",
|
|
146
|
+
"bm",
|
|
147
|
+
"bt",
|
|
148
|
+
"bo",
|
|
149
|
+
"bq",
|
|
150
|
+
"ba",
|
|
151
|
+
"bw",
|
|
152
|
+
"bv",
|
|
153
|
+
"br",
|
|
154
|
+
"io",
|
|
155
|
+
"bn",
|
|
156
|
+
"bg",
|
|
157
|
+
"bf",
|
|
158
|
+
"bi",
|
|
159
|
+
"cl",
|
|
160
|
+
"cn",
|
|
161
|
+
"ck",
|
|
162
|
+
"cr",
|
|
163
|
+
"cw",
|
|
164
|
+
"dk",
|
|
165
|
+
"cd",
|
|
166
|
+
"de",
|
|
167
|
+
"dm",
|
|
168
|
+
"do",
|
|
169
|
+
"dj",
|
|
170
|
+
"ec",
|
|
171
|
+
"ci",
|
|
172
|
+
"sv",
|
|
173
|
+
"er",
|
|
174
|
+
"ee",
|
|
175
|
+
"sz",
|
|
176
|
+
"fk",
|
|
177
|
+
"fo",
|
|
178
|
+
"fj",
|
|
179
|
+
"fi",
|
|
180
|
+
"fr",
|
|
181
|
+
"tf",
|
|
182
|
+
"gf",
|
|
183
|
+
"pf",
|
|
184
|
+
"ga",
|
|
185
|
+
"gm",
|
|
186
|
+
"ge",
|
|
187
|
+
"gh",
|
|
188
|
+
"gi",
|
|
189
|
+
"gd",
|
|
190
|
+
"gr",
|
|
191
|
+
"gl",
|
|
192
|
+
"gp",
|
|
193
|
+
"gu",
|
|
194
|
+
"gt",
|
|
195
|
+
"gg",
|
|
196
|
+
"gw",
|
|
197
|
+
"gn",
|
|
198
|
+
"gy",
|
|
199
|
+
"ht",
|
|
200
|
+
"hm",
|
|
201
|
+
"hn",
|
|
202
|
+
"hk",
|
|
203
|
+
"in",
|
|
204
|
+
"id",
|
|
205
|
+
"im",
|
|
206
|
+
"iq",
|
|
207
|
+
"ir",
|
|
208
|
+
"ie",
|
|
209
|
+
"is",
|
|
210
|
+
"il",
|
|
211
|
+
"it",
|
|
212
|
+
"jm",
|
|
213
|
+
"jp",
|
|
214
|
+
"ye",
|
|
215
|
+
"je",
|
|
216
|
+
"jo",
|
|
217
|
+
"vg",
|
|
218
|
+
"vi",
|
|
219
|
+
"ky",
|
|
220
|
+
"kh",
|
|
221
|
+
"cm",
|
|
222
|
+
"ca",
|
|
223
|
+
"cv",
|
|
224
|
+
"kz",
|
|
225
|
+
"qa",
|
|
226
|
+
"ke",
|
|
227
|
+
"kg",
|
|
228
|
+
"ki",
|
|
229
|
+
"cc",
|
|
230
|
+
"co",
|
|
231
|
+
"km",
|
|
232
|
+
"xk",
|
|
233
|
+
"hr",
|
|
234
|
+
"cu",
|
|
235
|
+
"kw",
|
|
236
|
+
"la",
|
|
237
|
+
"ls",
|
|
238
|
+
"lv",
|
|
239
|
+
"lb",
|
|
240
|
+
"lr",
|
|
241
|
+
"ly",
|
|
242
|
+
"li",
|
|
243
|
+
"lt",
|
|
244
|
+
"lu",
|
|
245
|
+
"mo",
|
|
246
|
+
"mg",
|
|
247
|
+
"mw",
|
|
248
|
+
"my",
|
|
249
|
+
"mv",
|
|
250
|
+
"ml",
|
|
251
|
+
"mt",
|
|
252
|
+
"ma",
|
|
253
|
+
"mh",
|
|
254
|
+
"mq",
|
|
255
|
+
"mr",
|
|
256
|
+
"mu",
|
|
257
|
+
"yt",
|
|
258
|
+
"mx",
|
|
259
|
+
"fm",
|
|
260
|
+
"md",
|
|
261
|
+
"mc",
|
|
262
|
+
"mn",
|
|
263
|
+
"me",
|
|
264
|
+
"ms",
|
|
265
|
+
"mz",
|
|
266
|
+
"mm",
|
|
267
|
+
"na",
|
|
268
|
+
"nr",
|
|
269
|
+
"np",
|
|
270
|
+
"nc",
|
|
271
|
+
"nz",
|
|
272
|
+
"ni",
|
|
273
|
+
"nl",
|
|
274
|
+
"ng",
|
|
275
|
+
"ne",
|
|
276
|
+
"nu",
|
|
277
|
+
"kp",
|
|
278
|
+
"mp",
|
|
279
|
+
"mk",
|
|
280
|
+
"nf",
|
|
281
|
+
"no",
|
|
282
|
+
"om",
|
|
283
|
+
"at",
|
|
284
|
+
"tl",
|
|
285
|
+
"pk",
|
|
286
|
+
"ps",
|
|
287
|
+
"pw",
|
|
288
|
+
"pa",
|
|
289
|
+
"pg",
|
|
290
|
+
"py",
|
|
291
|
+
"pe",
|
|
292
|
+
"ph",
|
|
293
|
+
"pn",
|
|
294
|
+
"pl",
|
|
295
|
+
"pt",
|
|
296
|
+
"pr",
|
|
297
|
+
"cg",
|
|
298
|
+
"re",
|
|
299
|
+
"rw",
|
|
300
|
+
"ro",
|
|
301
|
+
"ru",
|
|
302
|
+
"mf",
|
|
303
|
+
"sb",
|
|
304
|
+
"zm",
|
|
305
|
+
"ws",
|
|
306
|
+
"bl",
|
|
307
|
+
"sm",
|
|
308
|
+
"st",
|
|
309
|
+
"sa",
|
|
310
|
+
"se",
|
|
311
|
+
"ch",
|
|
312
|
+
"sn",
|
|
313
|
+
"rs",
|
|
314
|
+
"sc",
|
|
315
|
+
"sl",
|
|
316
|
+
"zw",
|
|
317
|
+
"sg",
|
|
318
|
+
"sx",
|
|
319
|
+
"sk",
|
|
320
|
+
"si",
|
|
321
|
+
"so",
|
|
322
|
+
"es",
|
|
323
|
+
"lk",
|
|
324
|
+
"sh",
|
|
325
|
+
"kn",
|
|
326
|
+
"lc",
|
|
327
|
+
"pm",
|
|
328
|
+
"vc",
|
|
329
|
+
"za",
|
|
330
|
+
"sd",
|
|
331
|
+
"gs",
|
|
332
|
+
"kr",
|
|
333
|
+
"ss",
|
|
334
|
+
"sr",
|
|
335
|
+
"sj",
|
|
336
|
+
"sy",
|
|
337
|
+
"tj",
|
|
338
|
+
"tw",
|
|
339
|
+
"tz",
|
|
340
|
+
"th",
|
|
341
|
+
"tg",
|
|
342
|
+
"tk",
|
|
343
|
+
"to",
|
|
344
|
+
"tt",
|
|
345
|
+
"td",
|
|
346
|
+
"cz",
|
|
347
|
+
"tn",
|
|
348
|
+
"tr",
|
|
349
|
+
"tm",
|
|
350
|
+
"tc",
|
|
351
|
+
"tv",
|
|
352
|
+
"ug",
|
|
353
|
+
"ua",
|
|
354
|
+
"hu",
|
|
355
|
+
"uy",
|
|
356
|
+
"uz",
|
|
357
|
+
"vu",
|
|
358
|
+
"va",
|
|
359
|
+
"ve",
|
|
360
|
+
"ae",
|
|
361
|
+
"gb",
|
|
362
|
+
"us",
|
|
363
|
+
"vn",
|
|
364
|
+
"wf",
|
|
365
|
+
"cx",
|
|
366
|
+
"eh",
|
|
367
|
+
"cf",
|
|
368
|
+
"cy",
|
|
369
|
+
];
|
|
120
370
|
|
|
121
371
|
export const languageOptions = { de: 9901, fr: 9903, it: 9904 };
|
|
122
372
|
|
|
@@ -153,37 +153,36 @@ export default class BuildingService extends GwrService {
|
|
|
153
153
|
buildingWork
|
|
154
154
|
) {
|
|
155
155
|
await Promise.all(
|
|
156
|
-
buildingWork.building.buildingEntrance.map(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
)
|
|
156
|
+
buildingWork.building.buildingEntrance.map((buildingEntrance) =>
|
|
157
|
+
Promise.all(
|
|
158
|
+
buildingEntrance.dwelling.map(async (dwelling) => {
|
|
159
|
+
if (
|
|
160
|
+
[Dwelling.STATUS_PROJECTED, Dwelling.STATUS_APPROVED].includes(
|
|
161
|
+
dwelling.dwellingStatus
|
|
162
|
+
)
|
|
163
|
+
) {
|
|
164
|
+
await this.dwelling.setToApprovedDwelling(
|
|
165
|
+
"setToApprovedDwelling",
|
|
166
|
+
cascadeLevel - 1,
|
|
167
|
+
isDryRun,
|
|
168
|
+
dwelling,
|
|
169
|
+
buildingWork.building.EGID
|
|
170
|
+
);
|
|
171
|
+
} else {
|
|
172
|
+
// Display message with link to dwelling with issue
|
|
173
|
+
const states =
|
|
174
|
+
cascadeLevel > 1
|
|
175
|
+
? [Dwelling.STATUS_PROJECTED, Dwelling.STATUS_APPROVED]
|
|
176
|
+
: [Dwelling.STATUS_APPROVED];
|
|
177
|
+
throw {
|
|
178
|
+
isLifeCycleError: true,
|
|
179
|
+
dwellingId: dwelling.EWID,
|
|
180
|
+
buildingId: buildingWork.building.EGID,
|
|
181
|
+
states,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
})
|
|
185
|
+
)
|
|
187
186
|
)
|
|
188
187
|
);
|
|
189
188
|
|
|
@@ -215,29 +214,28 @@ export default class BuildingService extends GwrService {
|
|
|
215
214
|
buildingWork
|
|
216
215
|
) {
|
|
217
216
|
await Promise.all(
|
|
218
|
-
buildingWork.building.buildingEntrance.map(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
217
|
+
buildingWork.building.buildingEntrance.map((buildingEntrance) =>
|
|
218
|
+
Promise.all(
|
|
219
|
+
buildingEntrance.dwelling.map(async (dwelling) => {
|
|
220
|
+
if (
|
|
221
|
+
![
|
|
222
|
+
Dwelling.STATUS_APPROVED,
|
|
223
|
+
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
224
|
+
].includes(dwelling.dwellingStatus)
|
|
225
|
+
) {
|
|
226
|
+
// Display message with link to dwelling with issue
|
|
227
|
+
throw {
|
|
228
|
+
isLifeCycleError: true,
|
|
229
|
+
dwellingId: dwelling.EWID,
|
|
230
|
+
buildingId: buildingWork.building.EGID,
|
|
231
|
+
states: [
|
|
224
232
|
Dwelling.STATUS_APPROVED,
|
|
225
233
|
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
226
|
-
]
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
dwellingId: dwelling.EWID,
|
|
232
|
-
buildingId: buildingWork.building.EGID,
|
|
233
|
-
states: [
|
|
234
|
-
Dwelling.STATUS_APPROVED,
|
|
235
|
-
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
236
|
-
],
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
})
|
|
240
|
-
)
|
|
234
|
+
],
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
})
|
|
238
|
+
)
|
|
241
239
|
)
|
|
242
240
|
);
|
|
243
241
|
|
|
@@ -271,31 +269,30 @@ export default class BuildingService extends GwrService {
|
|
|
271
269
|
buildingWork
|
|
272
270
|
) {
|
|
273
271
|
await Promise.all(
|
|
274
|
-
buildingWork.building.buildingEntrance.map(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
272
|
+
buildingWork.building.buildingEntrance.map((buildingEntrance) =>
|
|
273
|
+
Promise.all(
|
|
274
|
+
buildingEntrance.dwelling.map(async (dwelling) => {
|
|
275
|
+
if (
|
|
276
|
+
![
|
|
277
|
+
Dwelling.STATUS_APPROVED,
|
|
278
|
+
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
279
|
+
Dwelling.STATUS_COMPLETED,
|
|
280
|
+
].includes(dwelling.dwellingStatus)
|
|
281
|
+
) {
|
|
282
|
+
// Display message with link to dwelling with issue
|
|
283
|
+
throw {
|
|
284
|
+
isLifeCycleError: true,
|
|
285
|
+
dwellingId: dwelling.EWID,
|
|
286
|
+
buildingId: buildingWork.building.EGID,
|
|
287
|
+
states: [
|
|
280
288
|
Dwelling.STATUS_APPROVED,
|
|
281
289
|
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
282
290
|
Dwelling.STATUS_COMPLETED,
|
|
283
|
-
]
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
dwellingId: dwelling.EWID,
|
|
289
|
-
buildingId: buildingWork.building.EGID,
|
|
290
|
-
states: [
|
|
291
|
-
Dwelling.STATUS_APPROVED,
|
|
292
|
-
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
293
|
-
Dwelling.STATUS_COMPLETED,
|
|
294
|
-
],
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
})
|
|
298
|
-
)
|
|
291
|
+
],
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
})
|
|
295
|
+
)
|
|
299
296
|
)
|
|
300
297
|
);
|
|
301
298
|
|
|
@@ -327,47 +324,46 @@ export default class BuildingService extends GwrService {
|
|
|
327
324
|
buildingWork
|
|
328
325
|
) {
|
|
329
326
|
await Promise.all(
|
|
330
|
-
buildingWork.building.buildingEntrance.map(
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
) {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
buildingWork.building.yearOfDemolition;
|
|
344
|
-
}
|
|
345
|
-
await this.dwelling.setToDemolishedDwelling(
|
|
346
|
-
"setToDemolishedDwelling",
|
|
347
|
-
cascadeLevel - 1,
|
|
348
|
-
isDryRun,
|
|
349
|
-
dwelling,
|
|
350
|
-
buildingWork.building.EGID
|
|
351
|
-
);
|
|
352
|
-
} else {
|
|
353
|
-
// Display message with link to dwelling with issue
|
|
354
|
-
const states =
|
|
355
|
-
cascadeLevel > 1
|
|
356
|
-
? [
|
|
357
|
-
Dwelling.STATUS_COMPLETED,
|
|
358
|
-
Dwelling.STATUS_UNUSABLE,
|
|
359
|
-
Dwelling.STATUS_DEMOLISHED,
|
|
360
|
-
]
|
|
361
|
-
: [Dwelling.STATUS_DEMOLISHED];
|
|
362
|
-
throw {
|
|
363
|
-
isLifeCycleError: true,
|
|
364
|
-
dwellingId: dwelling.EWID,
|
|
365
|
-
buildingId: buildingWork.building.EGID,
|
|
366
|
-
states,
|
|
367
|
-
};
|
|
327
|
+
buildingWork.building.buildingEntrance.map((buildingEntrance) =>
|
|
328
|
+
Promise.all(
|
|
329
|
+
buildingEntrance.dwelling.map(async (dwelling) => {
|
|
330
|
+
if (
|
|
331
|
+
[
|
|
332
|
+
Dwelling.STATUS_COMPLETED,
|
|
333
|
+
Dwelling.STATUS_UNUSABLE,
|
|
334
|
+
Dwelling.STATUS_DEMOLISHED,
|
|
335
|
+
].includes(dwelling.dwellingStatus)
|
|
336
|
+
) {
|
|
337
|
+
if (dwelling.dwellingStatus !== Dwelling.STATUS_DEMOLISHED) {
|
|
338
|
+
dwelling.yearOfDemolition =
|
|
339
|
+
buildingWork.building.yearOfDemolition;
|
|
368
340
|
}
|
|
369
|
-
|
|
370
|
-
|
|
341
|
+
await this.dwelling.setToDemolishedDwelling(
|
|
342
|
+
"setToDemolishedDwelling",
|
|
343
|
+
cascadeLevel - 1,
|
|
344
|
+
isDryRun,
|
|
345
|
+
dwelling,
|
|
346
|
+
buildingWork.building.EGID
|
|
347
|
+
);
|
|
348
|
+
} else {
|
|
349
|
+
// Display message with link to dwelling with issue
|
|
350
|
+
const states =
|
|
351
|
+
cascadeLevel > 1
|
|
352
|
+
? [
|
|
353
|
+
Dwelling.STATUS_COMPLETED,
|
|
354
|
+
Dwelling.STATUS_UNUSABLE,
|
|
355
|
+
Dwelling.STATUS_DEMOLISHED,
|
|
356
|
+
]
|
|
357
|
+
: [Dwelling.STATUS_DEMOLISHED];
|
|
358
|
+
throw {
|
|
359
|
+
isLifeCycleError: true,
|
|
360
|
+
dwellingId: dwelling.EWID,
|
|
361
|
+
buildingId: buildingWork.building.EGID,
|
|
362
|
+
states,
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
})
|
|
366
|
+
)
|
|
371
367
|
)
|
|
372
368
|
);
|
|
373
369
|
|
|
@@ -399,45 +395,44 @@ export default class BuildingService extends GwrService {
|
|
|
399
395
|
buildingWork
|
|
400
396
|
) {
|
|
401
397
|
await Promise.all(
|
|
402
|
-
buildingWork.building.buildingEntrance.map(
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
)
|
|
398
|
+
buildingWork.building.buildingEntrance.map((buildingEntrance) =>
|
|
399
|
+
Promise.all(
|
|
400
|
+
buildingEntrance.dwelling.map(async (dwelling) => {
|
|
401
|
+
if (
|
|
402
|
+
[
|
|
403
|
+
Dwelling.STATUS_PROJECTED,
|
|
404
|
+
Dwelling.STATUS_APPROVED,
|
|
405
|
+
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
406
|
+
Dwelling.STATUS_NOT_REALIZED,
|
|
407
|
+
].includes(dwelling.dwellingStatus)
|
|
408
|
+
) {
|
|
409
|
+
await this.dwelling.setToNotRealizedDwelling(
|
|
410
|
+
"setToNotRealizedDwelling",
|
|
411
|
+
cascadeLevel - 1,
|
|
412
|
+
isDryRun,
|
|
413
|
+
dwelling,
|
|
414
|
+
buildingWork.building.EGID
|
|
415
|
+
);
|
|
416
|
+
} else {
|
|
417
|
+
// Display message with link to dwelling with issue
|
|
418
|
+
const states =
|
|
419
|
+
cascadeLevel > 1
|
|
420
|
+
? [
|
|
421
|
+
Dwelling.STATUS_PROJECTED,
|
|
422
|
+
Dwelling.STATUS_APPROVED,
|
|
423
|
+
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
424
|
+
Dwelling.STATUS_NOT_REALIZED,
|
|
425
|
+
]
|
|
426
|
+
: [Dwelling.STATUS_NOT_REALIZED];
|
|
427
|
+
throw {
|
|
428
|
+
isLifeCycleError: true,
|
|
429
|
+
dwellingId: dwelling.EWID,
|
|
430
|
+
buildingId: buildingWork.building.EGID,
|
|
431
|
+
states,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
})
|
|
435
|
+
)
|
|
441
436
|
)
|
|
442
437
|
);
|
|
443
438
|
|
|
@@ -469,41 +464,40 @@ export default class BuildingService extends GwrService {
|
|
|
469
464
|
buildingWork
|
|
470
465
|
) {
|
|
471
466
|
await Promise.all(
|
|
472
|
-
buildingWork.building.buildingEntrance.map(
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
)
|
|
467
|
+
buildingWork.building.buildingEntrance.map((buildingEntrance) =>
|
|
468
|
+
Promise.all(
|
|
469
|
+
buildingEntrance.dwelling.map(async (dwelling) => {
|
|
470
|
+
if (
|
|
471
|
+
[
|
|
472
|
+
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
473
|
+
Dwelling.STATUS_UNUSABLE,
|
|
474
|
+
].includes(dwelling.dwellingStatus)
|
|
475
|
+
) {
|
|
476
|
+
await this.dwelling.setToUnusableDwelling(
|
|
477
|
+
"setToUnusableDwelling",
|
|
478
|
+
cascadeLevel - 1,
|
|
479
|
+
isDryRun,
|
|
480
|
+
dwelling,
|
|
481
|
+
buildingWork.building.EGID
|
|
482
|
+
);
|
|
483
|
+
} else {
|
|
484
|
+
// Display message with link to dwelling with issue
|
|
485
|
+
const states =
|
|
486
|
+
cascadeLevel > 1
|
|
487
|
+
? [
|
|
488
|
+
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
489
|
+
Dwelling.STATUS_UNUSABLE,
|
|
490
|
+
]
|
|
491
|
+
: [Dwelling.STATUS_UNUSABLE];
|
|
492
|
+
throw {
|
|
493
|
+
isLifeCycleError: true,
|
|
494
|
+
dwellingId: dwelling.EWID,
|
|
495
|
+
buildingId: buildingWork.building.EGID,
|
|
496
|
+
states,
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
})
|
|
500
|
+
)
|
|
507
501
|
)
|
|
508
502
|
);
|
|
509
503
|
|
|
@@ -564,8 +558,4 @@ export default class BuildingService extends GwrService {
|
|
|
564
558
|
getCorrectionParameters(newStatus) {
|
|
565
559
|
return Building.buildingTransitionParametersMapping[newStatus];
|
|
566
560
|
}
|
|
567
|
-
|
|
568
|
-
getChangeHint(currentStatus, newStatus) {
|
|
569
|
-
return Building.buildingTransitionHint[currentStatus][newStatus];
|
|
570
|
-
}
|
|
571
561
|
}
|