ember-ebau-gwr 2.7.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/.github/workflows/release.yml +2 -0
- package/CHANGELOG.md +95 -0
- package/addon/components/back-route.hbs +10 -0
- package/addon/components/import-modal/building-data.hbs +64 -0
- package/addon/components/import-modal/dwelling-data.hbs +30 -0
- package/addon/components/import-modal/entrance-data.hbs +14 -0
- package/addon/components/import-modal.hbs +54 -0
- package/addon/components/import-modal.js +6 -0
- package/addon/components/link-building-modal.hbs +1 -1
- package/addon/components/link-building-modal.js +2 -0
- package/addon/components/link-street.hbs +105 -0
- package/addon/components/link-street.js +24 -0
- package/addon/components/linked-models.hbs +12 -6
- package/addon/components/linked-models.js +6 -0
- package/addon/components/linked-projects.hbs +1 -1
- package/addon/components/linked-projects.js +6 -0
- 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/date.hbs +1 -0
- package/addon/components/model-form/date.js +6 -6
- package/addon/components/model-form/diff.hbs +40 -27
- package/addon/components/model-form/field.hbs +13 -8
- package/addon/components/model-form/field.js +36 -9
- package/addon/components/model-form/header/actions.hbs +70 -36
- package/addon/components/model-form/header/actions.js +6 -0
- package/addon/components/model-form/header/status-selector/submit-parameters.hbs +1 -1
- package/addon/components/model-form/header/status-selector.hbs +1 -1
- package/addon/components/model-form/header.hbs +4 -2
- package/addon/components/model-form/submit-errors.hbs +41 -23
- package/addon/components/model-form.hbs +6 -5
- package/addon/components/model-form.js +25 -5
- package/addon/components/model-inview.hbs +8 -0
- package/addon/components/model-inview.js +12 -0
- package/addon/components/project-form/date.hbs +1 -1
- package/addon/components/project-form/field.hbs +1 -1
- package/addon/components/project-form/field.js +5 -1
- package/addon/components/search/filters.hbs +0 -5
- package/addon/components/search/filters.js +1 -3
- package/addon/components/sub-nav.hbs +5 -10
- package/addon/controllers/building/edit/dwelling/edit.js +27 -32
- package/addon/controllers/building/edit/dwellings.js +1 -1
- package/addon/controllers/building/edit/entrance/edit/index.js +26 -13
- package/addon/controllers/building/edit/entrance/edit/link-street.js +45 -20
- package/addon/controllers/building/edit/entrances.js +18 -2
- package/addon/controllers/building/edit/form.js +29 -44
- package/addon/controllers/import.js +70 -0
- package/addon/controllers/project/errors.js +25 -29
- package/addon/controllers/project/form.js +35 -48
- package/addon/controllers/project.js +2 -1
- package/addon/helpers/housing-stat-link.js +13 -0
- package/addon/helpers/is-unset.js +7 -0
- package/addon/helpers/show-model-field.js +13 -0
- package/addon/models/address.js +39 -9
- package/addon/models/building-entrance.js +17 -7
- package/addon/models/building.js +74 -75
- package/addon/models/client.js +1 -1
- package/addon/models/construction-project.js +18 -16
- package/addon/models/date-partially-known.js +1 -1
- package/addon/models/dwelling.js +28 -1
- package/addon/models/heating.js +1 -1
- package/addon/models/identification.js +2 -1
- package/addon/models/options.js +251 -1
- package/addon/models/organisation-identification.js +6 -3
- package/addon/models/realestate-identification.js +0 -6
- package/addon/models/street.js +2 -0
- package/addon/models/xml-model.js +18 -7
- package/addon/models.js +2 -1
- package/addon/routes/building/edit/entrance/edit/index.js +0 -2
- package/addon/routes/building/edit/entrance/edit/link-street.js +10 -1
- package/addon/routes/building/edit/entrance/new.js +9 -16
- package/addon/routes/building/edit/index.js +8 -1
- package/addon/routes/building/new.js +10 -1
- package/addon/routes/project/form.js +5 -0
- package/addon/routes/project/new.js +3 -2
- package/addon/services/building-entrance.js +13 -9
- package/addon/services/building.js +195 -193
- package/addon/services/construction-project.js +140 -152
- package/addon/services/gwr.js +47 -2
- package/addon/services/street.js +10 -0
- package/addon/templates/building/edit/dwelling/edit.hbs +29 -6
- package/addon/templates/building/edit/dwellings.hbs +7 -4
- package/addon/templates/building/edit/entrance/edit/index.hbs +49 -84
- package/addon/templates/building/edit/entrance/edit/link-street.hbs +41 -12
- package/addon/templates/building/edit/entrances.hbs +6 -3
- package/addon/templates/building/edit/form.hbs +75 -21
- package/addon/templates/project/errors.hbs +121 -132
- package/addon/templates/project/form.hbs +126 -97
- package/addon/templates/project/linked-buildings.hbs +13 -20
- package/addon/templates/project.hbs +29 -19
- 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-entrance.js +6 -4
- package/addon/validations/building-work.js +131 -11
- package/addon/validations/construction-project.js +154 -6
- package/addon/validations/coordinates.js +2 -2
- package/addon/validations/dwelling.js +61 -6
- package/addon/validations/realestate-identification.js +9 -9
- package/addon/validations/status/status-project-change.js +1 -1
- package/addon/validations/status/status-project-correction.js +1 -1
- package/addon/validators/range-state.js +27 -0
- package/addon/xml/helpers.js +4 -0
- package/addon/xml/templates/building-entrance.js +0 -14
- package/addon/xml/templates/building.js +0 -6
- package/addon/xml/templates/construction-project.js +2 -9
- package/addon/xml/templates/street.js +1 -7
- package/app/styles/ember-ebau-gwr.scss +32 -5
- package/config/environment.js +3 -0
- package/package.json +2 -2
- package/translations/building/de.yaml +13 -8
- package/translations/building-entrance/de.yaml +4 -10
- package/translations/construction-project/de.yaml +270 -15
- package/translations/de.yaml +46 -13
- package/translations/dwelling/de.yaml +14 -0
- package/translations/locality/de.yaml +2 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { inject as service } from "@ember/service";
|
|
2
2
|
import Building from "ember-ebau-gwr/models/building";
|
|
3
|
+
import BuildingEntrance from "ember-ebau-gwr/models/building-entrance";
|
|
3
4
|
import BuildingsList from "ember-ebau-gwr/models/buildings-list";
|
|
4
5
|
import Dwelling from "ember-ebau-gwr/models/dwelling";
|
|
5
6
|
|
|
6
7
|
import GwrService from "./gwr";
|
|
7
8
|
|
|
8
9
|
export default class BuildingService extends GwrService {
|
|
10
|
+
BuildingEntrance = BuildingEntrance;
|
|
11
|
+
|
|
9
12
|
@service constructionProject;
|
|
10
13
|
@service dwelling;
|
|
11
14
|
|
|
@@ -98,9 +101,18 @@ export default class BuildingService extends GwrService {
|
|
|
98
101
|
|
|
99
102
|
if (!response.ok) {
|
|
100
103
|
const xmlErrors = await response.text();
|
|
101
|
-
|
|
104
|
+
// Throw specific error message for
|
|
105
|
+
// mismatched locality - zip code errors
|
|
106
|
+
const errors = this.extractErrorsFromXML(
|
|
107
|
+
xmlErrors,
|
|
108
|
+
this.BuildingEntrance.LOCALITY_ERROR,
|
|
109
|
+
this.intl.t("ember-gwr.building.buildingEntrance.localityError")
|
|
110
|
+
);
|
|
102
111
|
|
|
103
112
|
await this.constructionProject.removeWorkFromProject(EPROID, work.ARBID);
|
|
113
|
+
|
|
114
|
+
buildingWork.ARBID = undefined;
|
|
115
|
+
buildingWork.isNew = true;
|
|
104
116
|
console.error("GWR API: addBuildingToConstructionProject failed");
|
|
105
117
|
throw errors;
|
|
106
118
|
}
|
|
@@ -141,37 +153,36 @@ export default class BuildingService extends GwrService {
|
|
|
141
153
|
buildingWork
|
|
142
154
|
) {
|
|
143
155
|
await Promise.all(
|
|
144
|
-
buildingWork.building.buildingEntrance.map(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
)
|
|
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
|
+
)
|
|
175
186
|
)
|
|
176
187
|
);
|
|
177
188
|
|
|
@@ -203,29 +214,28 @@ export default class BuildingService extends GwrService {
|
|
|
203
214
|
buildingWork
|
|
204
215
|
) {
|
|
205
216
|
await Promise.all(
|
|
206
|
-
buildingWork.building.buildingEntrance.map(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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: [
|
|
212
232
|
Dwelling.STATUS_APPROVED,
|
|
213
233
|
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
214
|
-
]
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
dwellingId: dwelling.EWID,
|
|
220
|
-
buildingId: buildingWork.building.EGID,
|
|
221
|
-
states: [
|
|
222
|
-
Dwelling.STATUS_APPROVED,
|
|
223
|
-
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
224
|
-
],
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
})
|
|
228
|
-
)
|
|
234
|
+
],
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
})
|
|
238
|
+
)
|
|
229
239
|
)
|
|
230
240
|
);
|
|
231
241
|
|
|
@@ -259,31 +269,30 @@ export default class BuildingService extends GwrService {
|
|
|
259
269
|
buildingWork
|
|
260
270
|
) {
|
|
261
271
|
await Promise.all(
|
|
262
|
-
buildingWork.building.buildingEntrance.map(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
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: [
|
|
268
288
|
Dwelling.STATUS_APPROVED,
|
|
269
289
|
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
270
290
|
Dwelling.STATUS_COMPLETED,
|
|
271
|
-
]
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
dwellingId: dwelling.EWID,
|
|
277
|
-
buildingId: buildingWork.building.EGID,
|
|
278
|
-
states: [
|
|
279
|
-
Dwelling.STATUS_APPROVED,
|
|
280
|
-
Dwelling.STATUS_CONSTRUCTION_STARTED,
|
|
281
|
-
Dwelling.STATUS_COMPLETED,
|
|
282
|
-
],
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
})
|
|
286
|
-
)
|
|
291
|
+
],
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
})
|
|
295
|
+
)
|
|
287
296
|
)
|
|
288
297
|
);
|
|
289
298
|
|
|
@@ -315,47 +324,46 @@ export default class BuildingService extends GwrService {
|
|
|
315
324
|
buildingWork
|
|
316
325
|
) {
|
|
317
326
|
await Promise.all(
|
|
318
|
-
buildingWork.building.buildingEntrance.map(
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
) {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
buildingWork.building.yearOfDemolition;
|
|
332
|
-
}
|
|
333
|
-
await this.dwelling.setToDemolishedDwelling(
|
|
334
|
-
"setToDemolishedDwelling",
|
|
335
|
-
cascadeLevel - 1,
|
|
336
|
-
isDryRun,
|
|
337
|
-
dwelling,
|
|
338
|
-
buildingWork.building.EGID
|
|
339
|
-
);
|
|
340
|
-
} else {
|
|
341
|
-
// Display message with link to dwelling with issue
|
|
342
|
-
const states =
|
|
343
|
-
cascadeLevel > 1
|
|
344
|
-
? [
|
|
345
|
-
Dwelling.STATUS_COMPLETED,
|
|
346
|
-
Dwelling.STATUS_UNUSABLE,
|
|
347
|
-
Dwelling.STATUS_DEMOLISHED,
|
|
348
|
-
]
|
|
349
|
-
: [Dwelling.STATUS_DEMOLISHED];
|
|
350
|
-
throw {
|
|
351
|
-
isLifeCycleError: true,
|
|
352
|
-
dwellingId: dwelling.EWID,
|
|
353
|
-
buildingId: buildingWork.building.EGID,
|
|
354
|
-
states,
|
|
355
|
-
};
|
|
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;
|
|
356
340
|
}
|
|
357
|
-
|
|
358
|
-
|
|
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
|
+
)
|
|
359
367
|
)
|
|
360
368
|
);
|
|
361
369
|
|
|
@@ -387,45 +395,44 @@ export default class BuildingService extends GwrService {
|
|
|
387
395
|
buildingWork
|
|
388
396
|
) {
|
|
389
397
|
await Promise.all(
|
|
390
|
-
buildingWork.building.buildingEntrance.map(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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
|
-
)
|
|
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
|
+
)
|
|
429
436
|
)
|
|
430
437
|
);
|
|
431
438
|
|
|
@@ -457,41 +464,40 @@ export default class BuildingService extends GwrService {
|
|
|
457
464
|
buildingWork
|
|
458
465
|
) {
|
|
459
466
|
await Promise.all(
|
|
460
|
-
buildingWork.building.buildingEntrance.map(
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
)
|
|
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
|
+
)
|
|
495
501
|
)
|
|
496
502
|
);
|
|
497
503
|
|
|
@@ -552,8 +558,4 @@ export default class BuildingService extends GwrService {
|
|
|
552
558
|
getCorrectionParameters(newStatus) {
|
|
553
559
|
return Building.buildingTransitionParametersMapping[newStatus];
|
|
554
560
|
}
|
|
555
|
-
|
|
556
|
-
getChangeHint(currentStatus, newStatus) {
|
|
557
|
-
return Building.buildingTransitionHint[currentStatus][newStatus];
|
|
558
|
-
}
|
|
559
561
|
}
|