@open3cl/engine 1.0.9 → 1.0.11
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/features/dpe/domain/models/type-habitation.model.js +8 -0
- package/features/dpe/infrastructure/ecs/ecsTv.store.js +22 -0
- package/features/dpe/infrastructure/ecs/ecsTv.store.spec.js +33 -0
- package/features/dpe/infrastructure/{baieVitreeTv.store.js → enveloppe/baieVitreeTv.store.js} +74 -4
- package/features/dpe/infrastructure/{baieVitreeTv.store.spec.js → enveloppe/baieVitreeTv.store.spec.js} +106 -0
- package/features/dpe/infrastructure/{pontThermiqueTv.store.js → enveloppe/pontThermiqueTv.store.js} +3 -3
- package/features/dpe/infrastructure/froid/frTv.store.js +36 -0
- package/features/dpe/infrastructure/froid/frTv.store.spec.js +52 -0
- package/features/engine/domain/apport_et_besoin/apport-et-besoin.service.js +74 -0
- package/features/engine/domain/apport_et_besoin/apport-et-besoin.service.spec.js +85 -0
- package/features/engine/domain/apport_et_besoin/apport_gratuit/apport-gratuit.service.js +134 -0
- package/features/engine/domain/apport_et_besoin/apport_gratuit/apport-gratuit.service.spec.js +167 -0
- package/features/engine/domain/apport_et_besoin/ecs/besoin-ecs.service.js +58 -0
- package/features/engine/domain/apport_et_besoin/ecs/besoin-ecs.service.spec.js +67 -0
- package/features/engine/domain/apport_et_besoin/froid/besoin-froid.service.js +131 -0
- package/features/engine/domain/apport_et_besoin/froid/besoin-froid.service.spec.js +229 -0
- package/features/engine/domain/apport_et_besoin/surface-sud-equivalente.service.js +168 -0
- package/features/engine/domain/apport_et_besoin/surface-sud-equivalente.service.spec.js +230 -0
- package/features/engine/domain/contexte.builder.js +103 -64
- package/features/engine/domain/contexte.builder.spec.js +99 -64
- package/features/engine/domain/engine.service.js +16 -2
- package/features/engine/domain/enveloppe/baie_vitree/deperdition-baie-vitree.service.js +2 -2
- package/features/engine/domain/enveloppe/baie_vitree/deperdition-baie-vitree.service.spec.js +1 -1
- package/features/engine/domain/enveloppe/deperdition-enveloppe.service.js +19 -0
- package/features/engine/domain/enveloppe/deperdition-enveloppe.service.spec.js +3 -3
- package/features/engine/domain/enveloppe/deperdition.service.js +2 -3
- package/features/engine/domain/enveloppe/espace_tampon/espace-tampon.service.js +44 -0
- package/features/engine/domain/enveloppe/espace_tampon/espace-tampon.service.spec.js +81 -0
- package/features/engine/domain/enveloppe/mur/deperdition-mur.service.js +3 -3
- package/features/engine/domain/enveloppe/mur/deperdition-mur.service.spec.js +30 -10
- package/features/engine/domain/enveloppe/plancher_bas/deperdition-plancher-bas.service.js +2 -2
- package/features/engine/domain/enveloppe/plancher_bas/deperdition-plancher-bas.service.spec.js +18 -6
- package/features/engine/domain/enveloppe/plancher_haut/deperdition-plancher-haut.service.js +2 -2
- package/features/engine/domain/enveloppe/plancher_haut/deperdition-plancher-haut.service.spec.js +21 -7
- package/features/engine/domain/enveloppe/pont_thermique/deperdition-pont-thermique.service.js +1 -1
- package/features/engine/domain/enveloppe/pont_thermique/deperdition-pont-thermique.service.spec.js +1 -1
- package/features/engine/domain/enveloppe/porte/deperdition-porte.service.js +1 -1
- package/features/engine/domain/enveloppe/porte/deperdition-porte.service.spec.js +2 -2
- package/features/engine/domain/enveloppe/ventilation/deperdition-ventilation.service.js +1 -1
- package/features/engine/domain/logement/nadeq.service.js +63 -0
- package/features/engine/domain/logement/nadeq.service.spec.js +61 -0
- package/features/engine/domain/models/contexte.model.ts +19 -5
- package/features/engine/domain/models/deperdition.model.ts +1 -1
- package/package.json +1 -1
- /package/features/dpe/infrastructure/{pontThermiqueTv.store.spec.js → enveloppe/pontThermiqueTv.store.spec.js} +0 -0
|
@@ -77,7 +77,9 @@ describe('Calcul de déperdition des murs', () => {
|
|
|
77
77
|
const ctx = {
|
|
78
78
|
effetJoule,
|
|
79
79
|
enumPeriodeConstructionId,
|
|
80
|
-
|
|
80
|
+
zoneClimatique: {
|
|
81
|
+
id: zoneClimatiqueId
|
|
82
|
+
}
|
|
81
83
|
};
|
|
82
84
|
|
|
83
85
|
/** @type {MurDE} */
|
|
@@ -105,7 +107,9 @@ describe('Calcul de déperdition des murs', () => {
|
|
|
105
107
|
const ctx = {
|
|
106
108
|
effetJoule: false,
|
|
107
109
|
enumPeriodeConstructionId: '6',
|
|
108
|
-
|
|
110
|
+
zoneClimatique: {
|
|
111
|
+
id: '3'
|
|
112
|
+
}
|
|
109
113
|
};
|
|
110
114
|
/** @type {MurDE} */
|
|
111
115
|
const de = {
|
|
@@ -129,7 +133,9 @@ describe('Calcul de déperdition des murs', () => {
|
|
|
129
133
|
const ctx = {
|
|
130
134
|
effetJoule: false,
|
|
131
135
|
enumPeriodeConstructionId: '6',
|
|
132
|
-
|
|
136
|
+
zoneClimatique: {
|
|
137
|
+
id: '3'
|
|
138
|
+
}
|
|
133
139
|
};
|
|
134
140
|
/** @type {MurDE} */
|
|
135
141
|
const de = {
|
|
@@ -153,7 +159,9 @@ describe('Calcul de déperdition des murs', () => {
|
|
|
153
159
|
const ctx = {
|
|
154
160
|
effetJoule: false,
|
|
155
161
|
enumPeriodeConstructionId: '6',
|
|
156
|
-
|
|
162
|
+
zoneClimatique: {
|
|
163
|
+
id: '3'
|
|
164
|
+
}
|
|
157
165
|
};
|
|
158
166
|
/** @type {MurDE} */
|
|
159
167
|
const de = {
|
|
@@ -176,7 +184,9 @@ describe('Calcul de déperdition des murs', () => {
|
|
|
176
184
|
const ctx = {
|
|
177
185
|
effetJoule: false,
|
|
178
186
|
enumPeriodeConstructionId: '6',
|
|
179
|
-
|
|
187
|
+
zoneClimatique: {
|
|
188
|
+
id: '3'
|
|
189
|
+
}
|
|
180
190
|
};
|
|
181
191
|
/** @type {MurDE} */
|
|
182
192
|
const de = {
|
|
@@ -199,7 +209,9 @@ describe('Calcul de déperdition des murs', () => {
|
|
|
199
209
|
const ctx = {
|
|
200
210
|
effetJoule: false,
|
|
201
211
|
enumPeriodeConstructionId: '6',
|
|
202
|
-
|
|
212
|
+
zoneClimatique: {
|
|
213
|
+
id: '3'
|
|
214
|
+
}
|
|
203
215
|
};
|
|
204
216
|
/** @type {MurDE} */
|
|
205
217
|
const de = {
|
|
@@ -222,7 +234,9 @@ describe('Calcul de déperdition des murs', () => {
|
|
|
222
234
|
const ctx = {
|
|
223
235
|
effetJoule: true,
|
|
224
236
|
enumPeriodeConstructionId: '1',
|
|
225
|
-
|
|
237
|
+
zoneClimatique: {
|
|
238
|
+
id: '3'
|
|
239
|
+
}
|
|
226
240
|
};
|
|
227
241
|
/** @type {MurDE} */
|
|
228
242
|
const de = {
|
|
@@ -246,7 +260,9 @@ describe('Calcul de déperdition des murs', () => {
|
|
|
246
260
|
const ctx = {
|
|
247
261
|
effetJoule: true,
|
|
248
262
|
enumPeriodeConstructionId: '1',
|
|
249
|
-
|
|
263
|
+
zoneClimatique: {
|
|
264
|
+
id: 3
|
|
265
|
+
}
|
|
250
266
|
};
|
|
251
267
|
/** @type {MurDE} */
|
|
252
268
|
const de = {
|
|
@@ -270,7 +286,9 @@ describe('Calcul de déperdition des murs', () => {
|
|
|
270
286
|
const ctx = {
|
|
271
287
|
effetJoule: false,
|
|
272
288
|
enumPeriodeConstructionId: '1',
|
|
273
|
-
|
|
289
|
+
zoneClimatique: {
|
|
290
|
+
id: 3
|
|
291
|
+
}
|
|
274
292
|
};
|
|
275
293
|
/** @type {MurDE} */
|
|
276
294
|
const de = {
|
|
@@ -294,7 +312,9 @@ describe('Calcul de déperdition des murs', () => {
|
|
|
294
312
|
const ctx = {
|
|
295
313
|
effetJoule: false,
|
|
296
314
|
enumPeriodeConstructionId: '1',
|
|
297
|
-
|
|
315
|
+
zoneClimatique: {
|
|
316
|
+
id: 3
|
|
317
|
+
}
|
|
298
318
|
};
|
|
299
319
|
/** @type {MurDE} */
|
|
300
320
|
const de = {
|
|
@@ -34,7 +34,7 @@ export class DeperditionPlancherBasService extends DeperditionService {
|
|
|
34
34
|
surfaceAiu: pbDE.surface_aiu,
|
|
35
35
|
surfaceAue: pbDE.surface_aue,
|
|
36
36
|
enumCfgIsolationLncId: pbDE.enum_cfg_isolation_lnc_id,
|
|
37
|
-
|
|
37
|
+
zoneClimatique: ctx.zoneClimatique.value
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
/** @type {PlancherBasDI} */
|
|
@@ -67,7 +67,7 @@ export class DeperditionPlancherBasService extends DeperditionService {
|
|
|
67
67
|
case '8': // année de construction saisie
|
|
68
68
|
upb = Math.min(
|
|
69
69
|
upbNu,
|
|
70
|
-
this.tvStore.getUpb(enumPeriodeIsolationId, ctx.
|
|
70
|
+
this.tvStore.getUpb(enumPeriodeIsolationId, ctx.zoneClimatique.id, ctx.effetJoule)
|
|
71
71
|
);
|
|
72
72
|
break;
|
|
73
73
|
case '3': // epaisseur isolation saisie justifiée par mesure ou observation
|
package/features/engine/domain/enveloppe/plancher_bas/deperdition-plancher-bas.service.spec.js
CHANGED
|
@@ -28,7 +28,9 @@ describe('Calcul de déperdition des planchers bas', () => {
|
|
|
28
28
|
const ctx = {
|
|
29
29
|
effetJoule: false,
|
|
30
30
|
enumPeriodeConstructionId: '6',
|
|
31
|
-
|
|
31
|
+
zoneClimatique: {
|
|
32
|
+
id: '3'
|
|
33
|
+
}
|
|
32
34
|
};
|
|
33
35
|
/** @type {PlancherBasDE} */
|
|
34
36
|
const de = {
|
|
@@ -53,7 +55,9 @@ describe('Calcul de déperdition des planchers bas', () => {
|
|
|
53
55
|
const ctx = {
|
|
54
56
|
effetJoule: false,
|
|
55
57
|
enumPeriodeConstructionId: '6',
|
|
56
|
-
|
|
58
|
+
zoneClimatique: {
|
|
59
|
+
id: '3'
|
|
60
|
+
}
|
|
57
61
|
};
|
|
58
62
|
/** @type {PlancherBasDE} */
|
|
59
63
|
const de = {
|
|
@@ -80,7 +84,9 @@ describe('Calcul de déperdition des planchers bas', () => {
|
|
|
80
84
|
const ctx = {
|
|
81
85
|
effetJoule: false,
|
|
82
86
|
enumPeriodeConstructionId: '6',
|
|
83
|
-
|
|
87
|
+
zoneClimatique: {
|
|
88
|
+
id: '3'
|
|
89
|
+
}
|
|
84
90
|
};
|
|
85
91
|
/** @type {PlancherBasDE} */
|
|
86
92
|
const de = {
|
|
@@ -103,7 +109,9 @@ describe('Calcul de déperdition des planchers bas', () => {
|
|
|
103
109
|
const ctx = {
|
|
104
110
|
effetJoule: false,
|
|
105
111
|
enumPeriodeConstructionId: '6',
|
|
106
|
-
|
|
112
|
+
zoneClimatique: {
|
|
113
|
+
id: '3'
|
|
114
|
+
}
|
|
107
115
|
};
|
|
108
116
|
/** @type {PlancherBasDE} */
|
|
109
117
|
const de = {
|
|
@@ -127,7 +135,9 @@ describe('Calcul de déperdition des planchers bas', () => {
|
|
|
127
135
|
const ctx = {
|
|
128
136
|
effetJoule: false,
|
|
129
137
|
enumPeriodeConstructionId: '6',
|
|
130
|
-
|
|
138
|
+
zoneClimatique: {
|
|
139
|
+
id: '3'
|
|
140
|
+
}
|
|
131
141
|
};
|
|
132
142
|
/** @type {PlancherBasDE} */
|
|
133
143
|
const de = {
|
|
@@ -150,7 +160,9 @@ describe('Calcul de déperdition des planchers bas', () => {
|
|
|
150
160
|
const ctx = {
|
|
151
161
|
effetJoule: false,
|
|
152
162
|
enumPeriodeConstructionId: '6',
|
|
153
|
-
|
|
163
|
+
zoneClimatique: {
|
|
164
|
+
id: '3'
|
|
165
|
+
}
|
|
154
166
|
};
|
|
155
167
|
/** @type {PlancherBasDE} */
|
|
156
168
|
const de = {
|
|
@@ -32,7 +32,7 @@ export class DeperditionPlancherHautService extends DeperditionService {
|
|
|
32
32
|
surfaceAiu: phDE.surface_aiu,
|
|
33
33
|
surfaceAue: phDE.surface_aue,
|
|
34
34
|
enumCfgIsolationLncId: phDE.enum_cfg_isolation_lnc_id,
|
|
35
|
-
|
|
35
|
+
zoneClimatique: ctx.zoneClimatique.value
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
/** @type {PlancherHautDI} */
|
|
@@ -69,7 +69,7 @@ export class DeperditionPlancherHautService extends DeperditionService {
|
|
|
69
69
|
this.tvStore.getUph(
|
|
70
70
|
enumPeriodeIsolationId,
|
|
71
71
|
this.#getTypeAdjacence(phDE),
|
|
72
|
-
ctx.
|
|
72
|
+
ctx.zoneClimatique.id,
|
|
73
73
|
ctx.effetJoule
|
|
74
74
|
)
|
|
75
75
|
);
|
package/features/engine/domain/enveloppe/plancher_haut/deperdition-plancher-haut.service.spec.js
CHANGED
|
@@ -28,7 +28,9 @@ describe('Calcul de déperdition des planchers haut', () => {
|
|
|
28
28
|
const ctx = {
|
|
29
29
|
effetJoule: false,
|
|
30
30
|
enumPeriodeConstructionId: '2',
|
|
31
|
-
|
|
31
|
+
zoneClimatique: {
|
|
32
|
+
id: '3'
|
|
33
|
+
}
|
|
32
34
|
};
|
|
33
35
|
/** @type {PlancherHautDE} */
|
|
34
36
|
const de = {
|
|
@@ -50,7 +52,9 @@ describe('Calcul de déperdition des planchers haut', () => {
|
|
|
50
52
|
const ctx = {
|
|
51
53
|
effetJoule: false,
|
|
52
54
|
enumPeriodeConstructionId: '1',
|
|
53
|
-
|
|
55
|
+
zoneClimatique: {
|
|
56
|
+
id: '3'
|
|
57
|
+
}
|
|
54
58
|
};
|
|
55
59
|
/** @type {PlancherHautDE} */
|
|
56
60
|
const de = {
|
|
@@ -73,7 +77,9 @@ describe('Calcul de déperdition des planchers haut', () => {
|
|
|
73
77
|
const ctx = {
|
|
74
78
|
effetJoule: true,
|
|
75
79
|
enumPeriodeConstructionId: '1',
|
|
76
|
-
|
|
80
|
+
zoneClimatique: {
|
|
81
|
+
id: '3'
|
|
82
|
+
}
|
|
77
83
|
};
|
|
78
84
|
/** @type {PlancherHautDE} */
|
|
79
85
|
const de = {
|
|
@@ -96,7 +102,9 @@ describe('Calcul de déperdition des planchers haut', () => {
|
|
|
96
102
|
const ctx = {
|
|
97
103
|
effetJoule: true,
|
|
98
104
|
enumPeriodeConstructionId: '1',
|
|
99
|
-
|
|
105
|
+
zoneClimatique: {
|
|
106
|
+
id: '3'
|
|
107
|
+
}
|
|
100
108
|
};
|
|
101
109
|
/** @type {PlancherHautDE} */
|
|
102
110
|
const de = {
|
|
@@ -119,7 +127,9 @@ describe('Calcul de déperdition des planchers haut', () => {
|
|
|
119
127
|
const ctx = {
|
|
120
128
|
effetJoule: false,
|
|
121
129
|
enumPeriodeConstructionId: '6',
|
|
122
|
-
|
|
130
|
+
zoneClimatique: {
|
|
131
|
+
id: '3'
|
|
132
|
+
}
|
|
123
133
|
};
|
|
124
134
|
/** @type {PlancherHautDE} */
|
|
125
135
|
const de = {
|
|
@@ -141,7 +151,9 @@ describe('Calcul de déperdition des planchers haut', () => {
|
|
|
141
151
|
const ctx = {
|
|
142
152
|
effetJoule: false,
|
|
143
153
|
enumPeriodeConstructionId: '6',
|
|
144
|
-
|
|
154
|
+
zoneClimatique: {
|
|
155
|
+
id: '3'
|
|
156
|
+
}
|
|
145
157
|
};
|
|
146
158
|
/** @type {PlancherHautDE} */
|
|
147
159
|
const de = {
|
|
@@ -164,7 +176,9 @@ describe('Calcul de déperdition des planchers haut', () => {
|
|
|
164
176
|
const ctx = {
|
|
165
177
|
effetJoule: false,
|
|
166
178
|
enumPeriodeConstructionId: '6',
|
|
167
|
-
|
|
179
|
+
zoneClimatique: {
|
|
180
|
+
id: '3'
|
|
181
|
+
}
|
|
168
182
|
};
|
|
169
183
|
/** @type {PlancherHautDE} */
|
|
170
184
|
const de = {
|
package/features/engine/domain/enveloppe/pont_thermique/deperdition-pont-thermique.service.js
CHANGED
|
@@ -3,7 +3,7 @@ import { DeperditionService } from '../deperdition.service.js';
|
|
|
3
3
|
import { logger } from '../../../../../core/util/logger/log-service.js';
|
|
4
4
|
import { compareReferences } from '../../../../../utils.js';
|
|
5
5
|
import { DeperditionMurService } from '../mur/deperdition-mur.service.js';
|
|
6
|
-
import { PontThermiqueTvStore } from '../../../../dpe/infrastructure/pontThermiqueTv.store.js';
|
|
6
|
+
import { PontThermiqueTvStore } from '../../../../dpe/infrastructure/enveloppe/pontThermiqueTv.store.js';
|
|
7
7
|
import enums from '../../../../../enums.js';
|
|
8
8
|
import { DeperditionPlancherHautService } from '../plancher_haut/deperdition-plancher-haut.service.js';
|
|
9
9
|
import { DeperditionPlancherBasService } from '../plancher_bas/deperdition-plancher-bas.service.js';
|
package/features/engine/domain/enveloppe/pont_thermique/deperdition-pont-thermique.service.spec.js
CHANGED
|
@@ -4,7 +4,7 @@ import { ContexteBuilder } from '../../contexte.builder.js';
|
|
|
4
4
|
import { DpeNormalizerService } from '../../../../normalizer/domain/dpe-normalizer.service.js';
|
|
5
5
|
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
|
6
6
|
import { DeperditionPontThermiqueService } from './deperdition-pont-thermique.service.js';
|
|
7
|
-
import { PontThermiqueTvStore } from '../../../../dpe/infrastructure/pontThermiqueTv.store.js';
|
|
7
|
+
import { PontThermiqueTvStore } from '../../../../dpe/infrastructure/enveloppe/pontThermiqueTv.store.js';
|
|
8
8
|
import { DeperditionMurService } from '../mur/deperdition-mur.service.js';
|
|
9
9
|
import { DeperditionPlancherHautService } from '../plancher_haut/deperdition-plancher-haut.service.js';
|
|
10
10
|
import { DeperditionPlancherBasService } from '../plancher_bas/deperdition-plancher-bas.service.js';
|
|
@@ -48,7 +48,7 @@ export class DeperditionPorteService extends DeperditionService {
|
|
|
48
48
|
surfaceAiu: porteDE.surface_aiu,
|
|
49
49
|
surfaceAue: porteDE.surface_aue,
|
|
50
50
|
enumCfgIsolationLncId: porteDE.enum_cfg_isolation_lnc_id,
|
|
51
|
-
|
|
51
|
+
zoneClimatique: ctx.zoneClimatique.value
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
return di;
|
|
@@ -14,7 +14,7 @@ describe('Calcul de déperdition des portes', () => {
|
|
|
14
14
|
|
|
15
15
|
describe('Determination de uPorte', () => {
|
|
16
16
|
/** @type {Contexte} */
|
|
17
|
-
const ctx = {
|
|
17
|
+
const ctx = { zoneClimatique: { id: 1 } };
|
|
18
18
|
|
|
19
19
|
test.each([
|
|
20
20
|
{ type: '1', label: 'porte simple en bois porte opaque pleine', uPorteExpected: 3.5 },
|
|
@@ -103,7 +103,7 @@ describe('Calcul de déperdition des portes', () => {
|
|
|
103
103
|
test.each(corpus)('vérification des DI des portes pour dpe %s', (ademeId) => {
|
|
104
104
|
const dpeRequest = getAdemeFileJson(ademeId);
|
|
105
105
|
/** @type {Contexte} */
|
|
106
|
-
const ctx = {
|
|
106
|
+
const ctx = { zoneClimatique: { id: dpeRequest.logement.meteo.enum_zone_climatique_id } };
|
|
107
107
|
const portes = dpeRequest.logement.enveloppe.porte_collection?.porte || [];
|
|
108
108
|
|
|
109
109
|
portes.forEach((p) => {
|
|
@@ -110,7 +110,7 @@ export class DeperditionVentilationService extends DeperditionService {
|
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* Déperdition thermique par renouvellement d’air due au système de ventilation
|
|
113
|
-
* @param surfaceHabitable {
|
|
113
|
+
* @param surfaceHabitable {number}
|
|
114
114
|
* @param debitsVentilation {{qvarep_conv?: number, qvasouf_conv?: number, smea_conv?: number}}
|
|
115
115
|
* @return number
|
|
116
116
|
*/
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { TypeDpe } from '../../../dpe/domain/models/type-habitation.model.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Calcul du nombre d’adultes équivalent Nadeq
|
|
5
|
+
* Chapitre 11.1 Calcul du besoin d’ECS
|
|
6
|
+
*
|
|
7
|
+
* Methode_de_calcul_3CL_DPE_2021 - Page 70
|
|
8
|
+
* Octobre 2021
|
|
9
|
+
* @see consolide_anne…arrete_du_31_03_2021_relatif_aux_methodes_et_procedures_applicables.pdf
|
|
10
|
+
*/
|
|
11
|
+
export class NadeqService {
|
|
12
|
+
/**
|
|
13
|
+
* @param typeDpe {TypeDpe}
|
|
14
|
+
* @param surfaceHabitable {number}
|
|
15
|
+
* @param nombreAppartement {number}
|
|
16
|
+
* @return {number}
|
|
17
|
+
*/
|
|
18
|
+
execute(typeDpe, surfaceHabitable, nombreAppartement) {
|
|
19
|
+
if (typeDpe === TypeDpe.MAISON) {
|
|
20
|
+
return this.#calculateIndividualNadeq(surfaceHabitable);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return this.#calculateCollectiveNadeq(
|
|
24
|
+
surfaceHabitable,
|
|
25
|
+
typeDpe === TypeDpe.APPARTEMENT ? 1 : nombreAppartement
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Calcul de nadeq pour une maison ou un logement individuel
|
|
31
|
+
* @param surfaceHabitableLogement {number}
|
|
32
|
+
* @returns {number}
|
|
33
|
+
*/
|
|
34
|
+
#calculateIndividualNadeq(surfaceHabitableLogement) {
|
|
35
|
+
let Nmax;
|
|
36
|
+
|
|
37
|
+
if (surfaceHabitableLogement < 30) Nmax = 1;
|
|
38
|
+
else if (surfaceHabitableLogement < 70) Nmax = 1.75 - 0.01875 * (70 - surfaceHabitableLogement);
|
|
39
|
+
else Nmax = 0.025 * surfaceHabitableLogement;
|
|
40
|
+
|
|
41
|
+
if (Nmax < 1.75) return Nmax;
|
|
42
|
+
else return 1.75 + 0.3 * (Nmax - 1.75);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Calcul de nadeq pour un logement collectif
|
|
47
|
+
*
|
|
48
|
+
* @param surfaceHabitableImmeuble {number}
|
|
49
|
+
* @param nombreAppartement {number}
|
|
50
|
+
* @returns {number}
|
|
51
|
+
*/
|
|
52
|
+
#calculateCollectiveNadeq(surfaceHabitableImmeuble, nombreAppartement) {
|
|
53
|
+
const Shmoy = surfaceHabitableImmeuble / nombreAppartement;
|
|
54
|
+
|
|
55
|
+
let Nmax;
|
|
56
|
+
if (Shmoy < 10) Nmax = 1;
|
|
57
|
+
else if (Shmoy < 50) Nmax = 1.75 - 0.01875 * (50 - Shmoy);
|
|
58
|
+
else Nmax = 0.035 * Shmoy;
|
|
59
|
+
|
|
60
|
+
if (Nmax < 1.75) return nombreAppartement * Nmax;
|
|
61
|
+
else return nombreAppartement * (1.75 + 0.3 * (Nmax - 1.75));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { NadeqService } from './nadeq.service.js';
|
|
3
|
+
import { TypeDpe } from '../../../dpe/domain/models/type-habitation.model.js';
|
|
4
|
+
|
|
5
|
+
describe('Nadeq unit tests', () => {
|
|
6
|
+
/**
|
|
7
|
+
* @see : Methode_de_calcul_3CL_DPE_2021-338.pdf Page 70
|
|
8
|
+
*/
|
|
9
|
+
const service = new NadeqService();
|
|
10
|
+
|
|
11
|
+
test.each([
|
|
12
|
+
{ surfaceHabitable: 8, expectedNadeq: 1 },
|
|
13
|
+
{ surfaceHabitable: 28, expectedNadeq: 1 },
|
|
14
|
+
{ surfaceHabitable: 45, expectedNadeq: 1.28125 },
|
|
15
|
+
{ surfaceHabitable: 51, expectedNadeq: 1.39375 },
|
|
16
|
+
{ surfaceHabitable: 70, expectedNadeq: 1.75 },
|
|
17
|
+
{ surfaceHabitable: 75, expectedNadeq: 1.7875 }
|
|
18
|
+
])(
|
|
19
|
+
`Typologie MAISON : Nombre d'adultes équivalent $expectedNadeq pour une surface de logement $surfaceHabitable`,
|
|
20
|
+
({ expectedNadeq, surfaceHabitable }) => {
|
|
21
|
+
expect(service.execute(TypeDpe.MAISON, surfaceHabitable)).toBe(expectedNadeq);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
test.each([
|
|
26
|
+
{ surfaceHabitable: 8, expectedNadeq: 1 },
|
|
27
|
+
{ surfaceHabitable: 28, expectedNadeq: 1.3375 },
|
|
28
|
+
{ surfaceHabitable: 45, expectedNadeq: 1.65625 },
|
|
29
|
+
{ surfaceHabitable: 51, expectedNadeq: 1.7605 },
|
|
30
|
+
{ surfaceHabitable: 70, expectedNadeq: 1.96 },
|
|
31
|
+
{ surfaceHabitable: 75, expectedNadeq: 2.0125 }
|
|
32
|
+
])(
|
|
33
|
+
`Typologie APPARTEMENT : Nombre d'adultes équivalent $expectedNadeq pour une surface de logement $surfaceHabitable`,
|
|
34
|
+
({ expectedNadeq, surfaceHabitable }) => {
|
|
35
|
+
expect(service.execute(TypeDpe.APPARTEMENT, surfaceHabitable)).toBeCloseTo(expectedNadeq, 2);
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
test.each([
|
|
40
|
+
{ surfaceHabitable: 8, expectedNadeq: 1, nombreAppartement: 1 },
|
|
41
|
+
{ surfaceHabitable: 8, expectedNadeq: 2, nombreAppartement: 2 },
|
|
42
|
+
{ surfaceHabitable: 28, expectedNadeq: 1.3375, nombreAppartement: 1 },
|
|
43
|
+
{ surfaceHabitable: 28, expectedNadeq: 2.15, nombreAppartement: 2 },
|
|
44
|
+
{ surfaceHabitable: 45, expectedNadeq: 1.65625, nombreAppartement: 1 },
|
|
45
|
+
{ surfaceHabitable: 45, expectedNadeq: 2.46875, nombreAppartement: 2 },
|
|
46
|
+
{ surfaceHabitable: 51, expectedNadeq: 1.7605, nombreAppartement: 1 },
|
|
47
|
+
{ surfaceHabitable: 51, expectedNadeq: 2.58125, nombreAppartement: 2 },
|
|
48
|
+
{ surfaceHabitable: 70, expectedNadeq: 1.96, nombreAppartement: 1 },
|
|
49
|
+
{ surfaceHabitable: 70, expectedNadeq: 2.9375, nombreAppartement: 2 },
|
|
50
|
+
{ surfaceHabitable: 75, expectedNadeq: 2.0125, nombreAppartement: 1 },
|
|
51
|
+
{ surfaceHabitable: 75, expectedNadeq: 3.03125, nombreAppartement: 2 }
|
|
52
|
+
])(
|
|
53
|
+
`Typologie IMMEUBLE : Nombre d'adultes équivalent $expectedNadeq pour une surface de logement $surfaceHabitable et un nombre d'apartement $nombreAppartement`,
|
|
54
|
+
({ expectedNadeq, surfaceHabitable, nombreAppartement }) => {
|
|
55
|
+
expect(service.execute(TypeDpe.IMMEUBLE, surfaceHabitable, nombreAppartement)).toBeCloseTo(
|
|
56
|
+
expectedNadeq,
|
|
57
|
+
2
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
});
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import { TypeHabitation } from '../../../dpe/domain/models/dpe.model';
|
|
1
|
+
import { TypeDpe, TypeHabitation } from '../../../dpe/domain/models/dpe.model';
|
|
2
2
|
|
|
3
3
|
export interface Contexte {
|
|
4
4
|
typeHabitation: TypeHabitation;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
typeDpe: TypeDpe;
|
|
6
|
+
enumPeriodeConstructionId: number;
|
|
7
|
+
surfaceHabitable: number;
|
|
8
|
+
hauteurSousPlafond: number;
|
|
9
|
+
nombreAppartement: number;
|
|
10
|
+
zoneClimatique: {
|
|
11
|
+
id: string;
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
altitude: {
|
|
15
|
+
id: string;
|
|
16
|
+
value: string;
|
|
17
|
+
};
|
|
9
18
|
effetJoule: boolean;
|
|
19
|
+
nadeq: number;
|
|
20
|
+
inertie: {
|
|
21
|
+
id: number;
|
|
22
|
+
ilpa: number;
|
|
23
|
+
};
|
|
10
24
|
}
|
package/package.json
CHANGED
|
File without changes
|