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
|
@@ -11,26 +11,11 @@
|
|
|
11
11
|
@models={{this.fetchBuildings.lastSuccessful.value}}
|
|
12
12
|
@modelName="building"
|
|
13
13
|
@removeLink={{this.removeBuildingLink}}
|
|
14
|
-
@searchRoute=
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@searchModels={{if
|
|
20
|
-
(eq this.project.typeOfConstructionProject 6011)
|
|
21
|
-
(array @model)
|
|
22
|
-
undefined
|
|
23
|
-
}}
|
|
24
|
-
@newRoute={{if
|
|
25
|
-
(eq this.project.typeOfConstructionProject 6011)
|
|
26
|
-
"building.new"
|
|
27
|
-
undefined
|
|
28
|
-
}}
|
|
29
|
-
@newModels={{if
|
|
30
|
-
(eq this.project.typeOfConstructionProject 6011)
|
|
31
|
-
(array @model)
|
|
32
|
-
undefined
|
|
33
|
-
}} as |model|
|
|
14
|
+
@searchRoute="search-building"
|
|
15
|
+
@searchModels={{array @model}}
|
|
16
|
+
@newRoute="building.new"
|
|
17
|
+
@newModels={{array @model}}
|
|
18
|
+
as |model|
|
|
34
19
|
>
|
|
35
20
|
<td class="uk-table-shrink">
|
|
36
21
|
<LinkTo
|
|
@@ -61,5 +46,13 @@
|
|
|
61
46
|
}}
|
|
62
47
|
</td>
|
|
63
48
|
</LinkedModels>
|
|
49
|
+
<div class="uk-flex uk-flex-middle uk-flex-center">
|
|
50
|
+
<div>
|
|
51
|
+
<span uk-icon="info" class="uk-margin-small-right"/>
|
|
52
|
+
</div>
|
|
53
|
+
<div>
|
|
54
|
+
{{t "ember-gwr.components.linkedModels.buildingInfo"}}
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
64
57
|
{{/if}}
|
|
65
58
|
</div>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
{{#if this.displayLandingPage}}
|
|
8
8
|
<LandingPage />
|
|
9
9
|
{{else}}
|
|
10
|
-
<div class="projects-header">
|
|
10
|
+
<div class="ember-ebau-gwr-projects-header">
|
|
11
11
|
<div class="uk-padding-small">
|
|
12
12
|
<LinkedProjects
|
|
13
13
|
@projects={{this.projects}}
|
|
@@ -19,23 +19,33 @@
|
|
|
19
19
|
<hr class="uk-margin-remove" />
|
|
20
20
|
<div
|
|
21
21
|
uk-alert
|
|
22
|
-
class="uk-
|
|
22
|
+
class="uk-margin-remove"
|
|
23
23
|
>
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
<div class="uk-flex uk-flex-between uk-flex-middle">
|
|
25
|
+
<div class="uk-flex uk-flex-middle uk-width-expand uk-margin-right">
|
|
26
|
+
<div class="uk-flex-none uk-margin-right">
|
|
27
|
+
<span uk-icon="icon: info"></span>
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
<div>
|
|
31
|
+
{{t "ember-gwr.nav.housingStatInfo"}}
|
|
32
|
+
</div>
|
|
33
|
+
<div>
|
|
34
|
+
{{t "ember-gwr.nav.deletionInfo"}}
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="uk-width-auto">
|
|
39
|
+
<a
|
|
40
|
+
class="uk-button uk-button-default"
|
|
41
|
+
href={{housing-stat-link}}
|
|
42
|
+
target="_blank"
|
|
43
|
+
rel="noopener noreferrer"
|
|
44
|
+
>
|
|
45
|
+
{{t "ember-gwr.nav.housingStatLink"}}
|
|
46
|
+
</a>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
39
49
|
</div>
|
|
40
50
|
</div>
|
|
41
51
|
<UkTab as |Tab|>
|
|
@@ -52,8 +62,8 @@
|
|
|
52
62
|
{{#if this.buildingTabInfoText}}
|
|
53
63
|
<div class="uk-padding-remove">
|
|
54
64
|
<span
|
|
55
|
-
uk-icon="icon: question"
|
|
56
|
-
uk-tooltip={{this.buildingTabInfoText}}
|
|
65
|
+
uk-icon="icon: question; ratio: 0.8"
|
|
66
|
+
uk-tooltip="title: {{this.buildingTabInfoText}}; container: {{this.config.modalContainer}}"
|
|
57
67
|
></span>
|
|
58
68
|
</div>
|
|
59
69
|
{{/if}}
|
package/addon/utils.js
ADDED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validateLength,
|
|
3
3
|
validatePresence,
|
|
4
|
+
validateNumber,
|
|
4
5
|
} from "ember-changeset-validations/validators";
|
|
5
6
|
|
|
6
|
-
import CoordinatesValidation from "./coordinates";
|
|
7
|
-
|
|
8
7
|
export default {
|
|
9
8
|
buildingEntranceNo: validateLength({ min: 1, max: 12, allowBlank: true }),
|
|
10
9
|
locality: {
|
|
10
|
+
swissZipCode: [
|
|
11
|
+
validatePresence(true),
|
|
12
|
+
validateNumber({ integer: true, gte: 1000, lte: 9699 }),
|
|
13
|
+
],
|
|
11
14
|
name: {
|
|
12
|
-
nameLong: validatePresence(true),
|
|
15
|
+
nameLong: [validatePresence(true), validateLength({ min: 2, max: 40 })],
|
|
13
16
|
},
|
|
14
17
|
},
|
|
15
|
-
...CoordinatesValidation,
|
|
16
18
|
};
|
|
@@ -1,18 +1,138 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validatePresence,
|
|
3
3
|
validateNumber,
|
|
4
|
-
|
|
4
|
+
validateLength,
|
|
5
|
+
validateDate,
|
|
5
6
|
} from "ember-changeset-validations/validators";
|
|
6
7
|
|
|
8
|
+
import buildingEntranceValidation from "./building-entrance";
|
|
7
9
|
import { coordinatesValidation } from "./coordinates";
|
|
10
|
+
import realestateIdentification from "./realestate-identification";
|
|
8
11
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
export function buildingWorkValidation(isNew = false) {
|
|
13
|
+
const validations = {
|
|
14
|
+
kindOfWork: validatePresence(true),
|
|
15
|
+
building: {
|
|
16
|
+
officialBuildingNo: [
|
|
17
|
+
validateNumber({ integer: true, positive: true, allowBlank: true }),
|
|
18
|
+
validateLength({ max: 12, allowBlank: true }),
|
|
19
|
+
],
|
|
20
|
+
nameOfBuilding: validateLength({ min: 3, max: 40, allowBlank: true }),
|
|
21
|
+
buildingCategory: validatePresence(true),
|
|
22
|
+
...coordinatesValidation("building"),
|
|
23
|
+
localCode1: validateLength({ max: 8, allowBlank: true }),
|
|
24
|
+
localCode2: validateLength({ max: 8, allowBlank: true }),
|
|
25
|
+
localCode3: validateLength({ max: 8, allowBlank: true }),
|
|
26
|
+
localCode4: validateLength({ max: 8, allowBlank: true }),
|
|
27
|
+
neighbourhood: validateNumber({ gte: 1000, allowBlank: true }),
|
|
28
|
+
buildingStatus: validatePresence(true),
|
|
29
|
+
dateOfConstruction: {
|
|
30
|
+
yearMonthDay: [
|
|
31
|
+
validateDate({
|
|
32
|
+
onOrAfter: new Date("1000-01-01"),
|
|
33
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
34
|
+
allowBlank: true,
|
|
35
|
+
}),
|
|
36
|
+
validateDate({
|
|
37
|
+
onOrBefore: new Date(),
|
|
38
|
+
message: "{description} must be on or before {onOrBefore}",
|
|
39
|
+
allowBlank: true,
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
yearOfDemolition: [
|
|
44
|
+
validateNumber({
|
|
45
|
+
integer: true,
|
|
46
|
+
gte: 1999,
|
|
47
|
+
lte: new Date().getFullYear(),
|
|
48
|
+
allowBlank: true,
|
|
49
|
+
}),
|
|
50
|
+
],
|
|
51
|
+
surfaceAreaOfBuilding: validateNumber({
|
|
52
|
+
integer: true,
|
|
53
|
+
gte: 1,
|
|
54
|
+
lte: 99999,
|
|
55
|
+
allowBlank: true,
|
|
56
|
+
}),
|
|
57
|
+
volume: {
|
|
58
|
+
volume: validateNumber({
|
|
59
|
+
integer: true,
|
|
60
|
+
gte: 1,
|
|
61
|
+
lte: 3000000,
|
|
62
|
+
allowBlank: true,
|
|
63
|
+
}),
|
|
64
|
+
informationSource: validatePresence({
|
|
65
|
+
presence: true,
|
|
66
|
+
on: "building.volume.volume",
|
|
67
|
+
}),
|
|
68
|
+
norm: validatePresence({
|
|
69
|
+
presence: true,
|
|
70
|
+
on: "building.volume.volume",
|
|
71
|
+
}),
|
|
72
|
+
},
|
|
73
|
+
numberOfFloors: validateNumber({
|
|
74
|
+
integer: true,
|
|
75
|
+
gte: 1,
|
|
76
|
+
lte: 99,
|
|
77
|
+
allowBlank: true,
|
|
78
|
+
}),
|
|
79
|
+
numberOfSeparateHabitableRooms: validateNumber({
|
|
80
|
+
integer: true,
|
|
81
|
+
gte: 0,
|
|
82
|
+
lte: 999,
|
|
83
|
+
allowBlank: true,
|
|
84
|
+
}),
|
|
85
|
+
energyRelevantSurface: validateNumber({
|
|
86
|
+
integer: true,
|
|
87
|
+
gte: 5,
|
|
88
|
+
lte: 900000,
|
|
89
|
+
allowBlank: true,
|
|
90
|
+
}),
|
|
91
|
+
thermotechnicalDeviceForHeating1: {
|
|
92
|
+
revisionDate: validateDate({
|
|
93
|
+
onOrAfter: new Date("2000-12-31"),
|
|
94
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
95
|
+
allowBlank: true,
|
|
96
|
+
}),
|
|
97
|
+
},
|
|
98
|
+
thermotechnicalDeviceForHeating2: {
|
|
99
|
+
revisionDate: validateDate({
|
|
100
|
+
onOrAfter: new Date("2000-12-31"),
|
|
101
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
102
|
+
allowBlank: true,
|
|
103
|
+
}),
|
|
104
|
+
},
|
|
105
|
+
thermotechnicalDeviceForWarmWater1: {
|
|
106
|
+
revisionDate: validateDate({
|
|
107
|
+
onOrAfter: new Date("2000-12-31"),
|
|
108
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
109
|
+
allowBlank: true,
|
|
110
|
+
}),
|
|
111
|
+
},
|
|
112
|
+
thermotechnicalDeviceForWarmWater2: {
|
|
113
|
+
revisionDate: validateDate({
|
|
114
|
+
onOrAfter: new Date("2000-12-31"),
|
|
115
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
116
|
+
allowBlank: true,
|
|
117
|
+
}),
|
|
118
|
+
},
|
|
119
|
+
buildingFreeText1: validateLength({ max: 32, allowBlank: true }),
|
|
120
|
+
buildingFreeText2: validateLength({ max: 32, allowBlank: true }),
|
|
121
|
+
...realestateIdentification,
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const validationsNew = {
|
|
126
|
+
...validations,
|
|
127
|
+
building: {
|
|
128
|
+
...validations.building,
|
|
129
|
+
buildingEntrance: {
|
|
130
|
+
...buildingEntranceValidation,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
return isNew ? validationsNew : validations;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export default buildingWorkValidation();
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
validatePresence,
|
|
3
3
|
validateLength,
|
|
4
4
|
validateNumber,
|
|
5
|
+
validateDate,
|
|
5
6
|
} from "ember-changeset-validations/validators";
|
|
6
7
|
|
|
7
8
|
import realestateIdentification from "./realestate-identification";
|
|
@@ -14,6 +15,8 @@ export default {
|
|
|
14
15
|
}),
|
|
15
16
|
extensionOfOfficialConstructionProjectFileNo: validateNumber({
|
|
16
17
|
integer: true,
|
|
18
|
+
gte: 0,
|
|
19
|
+
lte: 99,
|
|
17
20
|
allowBlank: true,
|
|
18
21
|
}),
|
|
19
22
|
typeOfConstructionProject: [
|
|
@@ -28,11 +31,105 @@ export default {
|
|
|
28
31
|
totalCostsOfProject: [
|
|
29
32
|
validatePresence(true),
|
|
30
33
|
validateNumber({ gte: 1000 }),
|
|
31
|
-
validateNumber({ lte:
|
|
34
|
+
validateNumber({ lte: 999999999000 }),
|
|
32
35
|
validateNumber({ integer: true }),
|
|
33
36
|
],
|
|
34
37
|
typeOfConstruction: [validatePresence(true)],
|
|
35
|
-
projectAnnouncementDate: [
|
|
38
|
+
projectAnnouncementDate: [
|
|
39
|
+
validatePresence(true),
|
|
40
|
+
validateDate({
|
|
41
|
+
onOrAfter: new Date("2000-01-01"),
|
|
42
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
43
|
+
}),
|
|
44
|
+
validateDate({
|
|
45
|
+
onOrBefore: new Date(),
|
|
46
|
+
message: "{description} must be on or before {onOrBefore}",
|
|
47
|
+
}),
|
|
48
|
+
],
|
|
49
|
+
buildingPermitIssueDate: [
|
|
50
|
+
validateDate({
|
|
51
|
+
onOrAfter: new Date("2000-01-01"),
|
|
52
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
53
|
+
allowBlank: true,
|
|
54
|
+
}),
|
|
55
|
+
validateDate({
|
|
56
|
+
onOrBefore: new Date(),
|
|
57
|
+
message: "{description} must be on or before {onOrBefore}",
|
|
58
|
+
allowBlank: true,
|
|
59
|
+
}),
|
|
60
|
+
],
|
|
61
|
+
withdrawalDate: [
|
|
62
|
+
validateDate({
|
|
63
|
+
onOrAfter: new Date("2000-01-01"),
|
|
64
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
65
|
+
allowBlank: true,
|
|
66
|
+
}),
|
|
67
|
+
validateDate({
|
|
68
|
+
onOrBefore: new Date(),
|
|
69
|
+
message: "{description} must be on or before {onOrBefore}",
|
|
70
|
+
allowBlank: true,
|
|
71
|
+
}),
|
|
72
|
+
],
|
|
73
|
+
projectStartDate: [
|
|
74
|
+
validateDate({
|
|
75
|
+
onOrAfter: new Date("2000-01-01"),
|
|
76
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
77
|
+
allowBlank: true,
|
|
78
|
+
}),
|
|
79
|
+
validateDate({
|
|
80
|
+
onOrBefore: new Date(),
|
|
81
|
+
message: "{description} must be on or before {onOrBefore}",
|
|
82
|
+
allowBlank: true,
|
|
83
|
+
}),
|
|
84
|
+
],
|
|
85
|
+
constructionAuthorisationDeniedDate: [
|
|
86
|
+
validateDate({
|
|
87
|
+
onOrAfter: new Date("2000-01-01"),
|
|
88
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
89
|
+
allowBlank: true,
|
|
90
|
+
}),
|
|
91
|
+
validateDate({
|
|
92
|
+
onOrBefore: new Date(),
|
|
93
|
+
message: "{description} must be on or before {onOrBefore}",
|
|
94
|
+
allowBlank: true,
|
|
95
|
+
}),
|
|
96
|
+
],
|
|
97
|
+
cancellationDate: [
|
|
98
|
+
validateDate({
|
|
99
|
+
onOrAfter: new Date("2000-01-01"),
|
|
100
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
101
|
+
allowBlank: true,
|
|
102
|
+
}),
|
|
103
|
+
validateDate({
|
|
104
|
+
onOrBefore: new Date(),
|
|
105
|
+
message: "{description} must be on or before {onOrBefore}",
|
|
106
|
+
allowBlank: true,
|
|
107
|
+
}),
|
|
108
|
+
],
|
|
109
|
+
projectCompletionDate: [
|
|
110
|
+
validateDate({
|
|
111
|
+
onOrAfter: new Date("2000-01-01"),
|
|
112
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
113
|
+
allowBlank: true,
|
|
114
|
+
}),
|
|
115
|
+
validateDate({
|
|
116
|
+
onOrBefore: new Date(),
|
|
117
|
+
message: "{description} must be on or before {onOrBefore}",
|
|
118
|
+
allowBlank: true,
|
|
119
|
+
}),
|
|
120
|
+
],
|
|
121
|
+
projectSuspensionDate: [
|
|
122
|
+
validateDate({
|
|
123
|
+
onOrAfter: new Date("2000-01-01"),
|
|
124
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
125
|
+
allowBlank: true,
|
|
126
|
+
}),
|
|
127
|
+
validateDate({
|
|
128
|
+
onOrBefore: new Date(),
|
|
129
|
+
message: "{description} must be on or before {onOrBefore}",
|
|
130
|
+
allowBlank: true,
|
|
131
|
+
}),
|
|
132
|
+
],
|
|
36
133
|
durationOfConstructionPhase: [
|
|
37
134
|
validateNumber({
|
|
38
135
|
gte: 1,
|
|
@@ -44,14 +141,65 @@ export default {
|
|
|
44
141
|
],
|
|
45
142
|
typeOfClient: [validatePresence(true)],
|
|
46
143
|
client: {
|
|
144
|
+
address: {
|
|
145
|
+
street: validateLength({ max: 60, allowBlank: true }),
|
|
146
|
+
houseNumber: validateLength({ max: 12, allowBlank: true }),
|
|
147
|
+
swissZipCode: [
|
|
148
|
+
validateNumber({
|
|
149
|
+
integer: true,
|
|
150
|
+
gte: 1000,
|
|
151
|
+
lte: 9699,
|
|
152
|
+
allowBlank: true,
|
|
153
|
+
}),
|
|
154
|
+
],
|
|
155
|
+
swissZipCodeAddOn: [
|
|
156
|
+
validateNumber({ integer: true, gte: 0, lte: 99, allowBlank: true }),
|
|
157
|
+
],
|
|
158
|
+
foreignZipCode: validateNumber({
|
|
159
|
+
integer: true,
|
|
160
|
+
positive: true,
|
|
161
|
+
allowBlank: true,
|
|
162
|
+
}),
|
|
163
|
+
addressLine2: validateLength({ max: 60, allowBlank: true }),
|
|
164
|
+
country: {
|
|
165
|
+
countryNameShort: [
|
|
166
|
+
validatePresence({
|
|
167
|
+
presence: true,
|
|
168
|
+
on: [
|
|
169
|
+
"client.identification.organisationIdentification.organisationName",
|
|
170
|
+
"client.identification.personIdentification.officialName",
|
|
171
|
+
],
|
|
172
|
+
}),
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
},
|
|
47
176
|
identification: {
|
|
48
177
|
organisationIdentification: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
178
|
+
organisationName: validateLength({ max: 60, allowBlank: true }),
|
|
179
|
+
organisationAdditionalName: validateLength({
|
|
180
|
+
max: 60,
|
|
181
|
+
allowBlank: true,
|
|
182
|
+
}),
|
|
183
|
+
},
|
|
184
|
+
personIdentification: {
|
|
185
|
+
officialName: [
|
|
186
|
+
validatePresence({
|
|
187
|
+
presence: true,
|
|
188
|
+
on: "client.identification.personIdentification.firstName",
|
|
189
|
+
}),
|
|
190
|
+
validateLength({ max: 60, allowBlank: true }),
|
|
191
|
+
],
|
|
192
|
+
firstName: [
|
|
193
|
+
validatePresence({
|
|
194
|
+
presence: true,
|
|
195
|
+
on: "client.identification.personIdentification.officialName",
|
|
196
|
+
}),
|
|
197
|
+
validateLength({ max: 60, allowBlank: true }),
|
|
198
|
+
],
|
|
53
199
|
},
|
|
54
200
|
},
|
|
55
201
|
},
|
|
202
|
+
projectFreeText1: validateLength({ max: 32, allowBlank: true }),
|
|
203
|
+
projectFreeText2: validateLength({ max: 32, allowBlank: true }),
|
|
56
204
|
...realestateIdentification,
|
|
57
205
|
};
|
|
@@ -18,12 +18,12 @@ export function coordinatesValidation(path = "") {
|
|
|
18
18
|
on: [eastPath, originPath],
|
|
19
19
|
}),
|
|
20
20
|
validateNumber({ gte: 1070000.0, allowBlank: true }),
|
|
21
|
-
validateNumber({ lte: 1300000.
|
|
21
|
+
validateNumber({ lte: 1300000.0, allowBlank: true }),
|
|
22
22
|
],
|
|
23
23
|
east: [
|
|
24
24
|
validatePresence({ presence: true, on: [northPath, originPath] }),
|
|
25
25
|
validateNumber({ gte: 2480000.0, allowBlank: true }),
|
|
26
|
-
validateNumber({ lte: 2840000.
|
|
26
|
+
validateNumber({ lte: 2840000.0, allowBlank: true }),
|
|
27
27
|
],
|
|
28
28
|
originOfCoordinates: [
|
|
29
29
|
validatePresence({
|
|
@@ -2,7 +2,10 @@ import {
|
|
|
2
2
|
validatePresence,
|
|
3
3
|
validateNumber,
|
|
4
4
|
validateLength,
|
|
5
|
+
validateDate,
|
|
5
6
|
} from "ember-changeset-validations/validators";
|
|
7
|
+
import validatePresenceState from "ember-ebau-gwr/validators/presence-state";
|
|
8
|
+
import validateRangeState from "ember-ebau-gwr/validators/range-state";
|
|
6
9
|
|
|
7
10
|
const yearValidation = {
|
|
8
11
|
allowBlank: true,
|
|
@@ -13,14 +16,66 @@ const yearValidation = {
|
|
|
13
16
|
};
|
|
14
17
|
|
|
15
18
|
export default {
|
|
16
|
-
|
|
19
|
+
administrativeDwellingNo: validateLength({ max: 12, allowBlank: true }),
|
|
20
|
+
physicalDwellingNo: validateLength({ max: 12, allowBlank: true }),
|
|
21
|
+
floorType: validatePresence(true),
|
|
22
|
+
floorNumber: [
|
|
23
|
+
validatePresenceState({
|
|
24
|
+
presence: true,
|
|
25
|
+
on: "floorType",
|
|
26
|
+
states: [3101, 3401],
|
|
27
|
+
}),
|
|
28
|
+
validateRangeState({
|
|
29
|
+
range: [1, 99],
|
|
30
|
+
on: "floorType",
|
|
31
|
+
states: [3101],
|
|
32
|
+
}),
|
|
33
|
+
validateRangeState({
|
|
34
|
+
range: [1, 19],
|
|
35
|
+
on: "floorType",
|
|
36
|
+
states: [3401],
|
|
37
|
+
}),
|
|
38
|
+
],
|
|
17
39
|
yearOfConstruction: validateNumber(yearValidation),
|
|
18
40
|
yearOfDemolition: validateNumber(yearValidation),
|
|
19
41
|
multipleFloor: validatePresence(true),
|
|
20
42
|
dwellingStatus: validatePresence(true),
|
|
21
|
-
noOfHabitableRooms: validateNumber({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
43
|
+
noOfHabitableRooms: validateNumber({
|
|
44
|
+
integer: true,
|
|
45
|
+
gte: 1,
|
|
46
|
+
lte: 99,
|
|
47
|
+
allowBlank: true,
|
|
48
|
+
}),
|
|
49
|
+
locationOfDwellingOnFloor: validateLength({
|
|
50
|
+
min: 3,
|
|
51
|
+
max: 40,
|
|
52
|
+
allowBlank: true,
|
|
53
|
+
}),
|
|
54
|
+
surfaceAreaOfDwelling: validateNumber({
|
|
55
|
+
integer: true,
|
|
56
|
+
gte: 1,
|
|
57
|
+
lte: 9999,
|
|
58
|
+
allowBlank: true,
|
|
59
|
+
}),
|
|
60
|
+
dwellingFreeText1: validateLength({ min: 1, max: 32, allowBlank: true }),
|
|
61
|
+
dwellingFreeText2: validateLength({ min: 1, max: 32, allowBlank: true }),
|
|
62
|
+
dwellingUsage: {
|
|
63
|
+
informationSource: validatePresence({
|
|
64
|
+
presence: true,
|
|
65
|
+
on: "dwellingUsage.usageCode",
|
|
66
|
+
}),
|
|
67
|
+
revisionDate: [
|
|
68
|
+
validateDate({
|
|
69
|
+
onOrAfter: new Date("2012-12-31"),
|
|
70
|
+
message: "{description} must be on or after {onOrAfter}",
|
|
71
|
+
allowBlank: true,
|
|
72
|
+
}),
|
|
73
|
+
validateDate({
|
|
74
|
+
onOrBefore: new Date(),
|
|
75
|
+
message: "{description} must be on or before {onOrBefore}",
|
|
76
|
+
allowBlank: true,
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
remark: validateLength({ max: 512, allowBlank: true }),
|
|
80
|
+
},
|
|
26
81
|
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validateLength,
|
|
3
3
|
validatePresence,
|
|
4
|
+
validateNumber,
|
|
4
5
|
} from "ember-changeset-validations/validators";
|
|
5
6
|
|
|
6
7
|
export function realestateIdentificationValidation(path = "") {
|
|
7
8
|
/*eslint-disable prefer-template*/
|
|
8
9
|
const EGRIDPath = `${path && path + "."}realestateIdentification.EGRID`;
|
|
9
|
-
const numberSuffixPath = `${
|
|
10
|
-
path && path + "."
|
|
11
|
-
}realestateIdentification.numberSuffix`;
|
|
12
10
|
const subDistrictPath = `${
|
|
13
11
|
path && path + "."
|
|
14
12
|
}realestateIdentification.subDistrict`;
|
|
15
|
-
const lotPath = `${path && path + "."}realestateIdentification.lot`;
|
|
16
13
|
/*eslint-enable prefer-template*/
|
|
17
14
|
|
|
18
15
|
return {
|
|
19
16
|
realestateIdentification: {
|
|
20
17
|
EGRID: validateLength({
|
|
21
18
|
min: 1,
|
|
22
|
-
max:
|
|
19
|
+
max: 14,
|
|
23
20
|
allowBlank: true,
|
|
24
21
|
}),
|
|
25
22
|
number: [
|
|
26
23
|
validatePresence({
|
|
27
24
|
presence: true,
|
|
28
|
-
on: [EGRIDPath,
|
|
25
|
+
on: [EGRIDPath, subDistrictPath],
|
|
29
26
|
}),
|
|
30
27
|
validateLength({ min: 1, max: 12, allowBlank: true }),
|
|
31
28
|
],
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
subDistrict: validateNumber({
|
|
30
|
+
integer: true,
|
|
31
|
+
gte: 0,
|
|
32
|
+
lte: 9999,
|
|
33
|
+
allowBlank: true,
|
|
34
|
+
}),
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
37
|
}
|