@open3cl/engine 1.0.6 → 1.0.8

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 (72) hide show
  1. package/11_nadeq.spec.js +3 -2
  2. package/16.2_production_enr.spec.js +1 -0
  3. package/3.2.1_mur.spec.js +1 -0
  4. package/3.2.2_plancher_bas.spec.js +1 -0
  5. package/3.3_baie_vitree.spec.js +1 -0
  6. package/6.1_apport_gratuit.spec.js +1 -0
  7. package/7_inertie.spec.js +4 -3
  8. package/9_chauffage.spec.js +1 -0
  9. package/9_conso_ch.spec.js +1 -0
  10. package/9_generateur_ch.spec.js +1 -0
  11. package/conso.spec.js +1 -0
  12. package/core/assets/domain/synchronize-assets.spec.js +9 -9
  13. package/core/assets/domain/synchronize-c1-tables.spec.js +4 -4
  14. package/core/assets/domain/synchronize-dpe-ges-limit-values-tables.spec.js +6 -6
  15. package/core/assets/domain/synchronize-enum-tables.spec.js +10 -10
  16. package/core/assets/domain/synchronize-solicitations-tables.spec.js +6 -6
  17. package/core/assets/domain/synchronize-valeur-tables.spec.js +14 -14
  18. package/core/file/infrastructure/adapter/file.store.spec.js +5 -4
  19. package/core/tv/infrastructure/tvs.store.spec.js +3 -2
  20. package/core/util/infrastructure/object-util.spec.js +2 -1
  21. package/core/util/logger/log-service.js +47 -0
  22. package/features/dpe/domain/models/baie-ets.model.ts +12 -0
  23. package/features/dpe/domain/models/baie-vitree.model.ts +97 -0
  24. package/features/dpe/domain/models/climatisation.model.ts +25 -0
  25. package/features/dpe/domain/models/dpe.model.ts +194 -0
  26. package/features/dpe/domain/models/ets.model.ts +19 -0
  27. package/features/dpe/domain/models/installation-chauffage.model.ts +101 -0
  28. package/features/dpe/domain/models/installation-ecs.model.ts +76 -0
  29. package/features/dpe/domain/models/mur.model.ts +37 -0
  30. package/features/dpe/domain/models/plancher-bas.model.ts +38 -0
  31. package/features/dpe/domain/models/plancher-haut.model.ts +33 -0
  32. package/features/dpe/domain/models/pont-thermique.model.ts +21 -0
  33. package/features/dpe/domain/models/porte.model.ts +31 -0
  34. package/features/dpe/domain/models/production-elec-enr.model.ts +27 -0
  35. package/features/dpe/domain/models/sortie.model.ts +178 -0
  36. package/features/dpe/domain/models/type-habitation.model.js +8 -0
  37. package/features/dpe/domain/models/type-ventilation.model.js +8 -0
  38. package/features/dpe/domain/models/ventilation.model.ts +33 -0
  39. package/features/dpe/infrastructure/baieVitreeTv.store.js +292 -0
  40. package/features/dpe/infrastructure/baieVitreeTv.store.spec.js +352 -0
  41. package/features/dpe/infrastructure/tv.store.js +356 -0
  42. package/features/dpe/infrastructure/tv.store.spec.js +607 -0
  43. package/features/engine/domain/constants.js +1 -0
  44. package/features/engine/domain/contexte.builder.js +140 -0
  45. package/features/engine/domain/contexte.builder.spec.js +152 -0
  46. package/features/engine/domain/engine.service.js +139 -0
  47. package/features/engine/domain/engine.service.spec.js +7 -0
  48. package/features/engine/domain/enveloppe/baie_vitree/deperdition-baie-vitree.service.js +292 -0
  49. package/features/engine/domain/enveloppe/baie_vitree/deperdition-baie-vitree.service.spec.js +484 -0
  50. package/features/engine/domain/enveloppe/deperdition-enveloppe.service.js +278 -0
  51. package/features/engine/domain/enveloppe/deperdition-enveloppe.service.spec.js +282 -0
  52. package/features/engine/domain/enveloppe/deperdition.service.js +101 -0
  53. package/features/engine/domain/enveloppe/mur/deperdition-mur.service.js +168 -0
  54. package/features/engine/domain/enveloppe/mur/deperdition-mur.service.spec.js +345 -0
  55. package/features/engine/domain/enveloppe/plancher_bas/deperdition-plancher-bas.service.js +169 -0
  56. package/features/engine/domain/enveloppe/plancher_bas/deperdition-plancher-bas.service.spec.js +200 -0
  57. package/features/engine/domain/enveloppe/plancher_haut/deperdition-plancher-haut.service.js +136 -0
  58. package/features/engine/domain/enveloppe/plancher_haut/deperdition-plancher-haut.service.spec.js +211 -0
  59. package/features/engine/domain/enveloppe/porte/deperdition-porte.service.js +56 -0
  60. package/features/engine/domain/enveloppe/porte/deperdition-porte.service.spec.js +116 -0
  61. package/features/engine/domain/enveloppe/ventilation/deperdition-ventilation.service.js +338 -0
  62. package/features/engine/domain/enveloppe/ventilation/deperdition-ventilation.service.spec.js +442 -0
  63. package/features/engine/domain/models/contexte.model.ts +10 -0
  64. package/features/engine/domain/models/deperdition.model.ts +8 -0
  65. package/features/normalizer/domain/dpe-normalizer.service.js +24 -0
  66. package/features/normalizer/domain/dpe-normalizer.service.spec.js +3 -0
  67. package/ficheTechnique.spec.js +4 -3
  68. package/output.js +1 -0
  69. package/package.json +9 -8
  70. package/tv-v2.js +79121 -0
  71. package/utils.js +2 -2
  72. package/utils.spec.js +4 -3
@@ -0,0 +1,442 @@
1
+ import { TvStore } from '../../../../dpe/infrastructure/tv.store.js';
2
+ import { DeperditionVentilationService } from './deperdition-ventilation.service.js';
3
+ import { beforeEach, describe, expect, test, vi } from 'vitest';
4
+ import { TypeHabitation } from '../../../../dpe/domain/models/type-habitation.model.js';
5
+ import corpus from '../../../../../../test/corpus-sano.json';
6
+ import { getAdemeFileJson } from '../../../../../../test/test-helpers.js';
7
+ import { DpeNormalizerService } from '../../../../normalizer/domain/dpe-normalizer.service.js';
8
+ import { ContexteBuilder } from '../../contexte.builder.js';
9
+ import { DeperditionEnveloppeService } from '../deperdition-enveloppe.service.js';
10
+
11
+ /** @type {DeperditionVentilationService} **/
12
+ let service;
13
+
14
+ /** @type {DpeNormalizerService} **/
15
+ let normalizerService;
16
+
17
+ /** @type {DeperditionEnveloppeService} **/
18
+ let deperditionEnveloppeService;
19
+
20
+ /** @type {ContexteBuilder} **/
21
+ let contexteBuilder;
22
+
23
+ /** @type {TvStore} **/
24
+ let tvStore;
25
+
26
+ describe('Calcul de déperdition des portes', () => {
27
+ beforeEach(() => {
28
+ tvStore = new TvStore();
29
+ service = new DeperditionVentilationService(tvStore);
30
+ normalizerService = new DpeNormalizerService();
31
+ contexteBuilder = new ContexteBuilder();
32
+ deperditionEnveloppeService = new DeperditionEnveloppeService();
33
+ });
34
+
35
+ describe('Determination de q4paConv', () => {
36
+ /** @type {Contexte} */
37
+ let ctx = { typeHabitation: TypeHabitation.MAISON };
38
+
39
+ test.each([
40
+ {
41
+ q4paConvSaisi: undefined,
42
+ enumPeriodeConstructionId: '1',
43
+ surfaceIsolee: 0,
44
+ surfaceNonIsolee: 0,
45
+ surfaceMenuiserieAvecJoint: 0,
46
+ surfaceMenuiserieSansJoint: 0,
47
+ expectedIsolationSurface: '0',
48
+ expectedPresenceJointsMenuiserie: undefined
49
+ },
50
+ {
51
+ q4paConvSaisi: undefined,
52
+ enumPeriodeConstructionId: '1',
53
+ surfaceIsolee: 200,
54
+ surfaceNonIsolee: 100,
55
+ surfaceMenuiserieAvecJoint: 0,
56
+ surfaceMenuiserieSansJoint: 0,
57
+ expectedIsolationSurface: '1',
58
+ expectedPresenceJointsMenuiserie: undefined
59
+ },
60
+ {
61
+ q4paConvSaisi: undefined,
62
+ enumPeriodeConstructionId: '1',
63
+ surfaceIsolee: 200,
64
+ surfaceNonIsolee: 300,
65
+ surfaceMenuiserieAvecJoint: 100,
66
+ surfaceMenuiserieSansJoint: 0,
67
+ expectedIsolationSurface: '0',
68
+ expectedPresenceJointsMenuiserie: '1'
69
+ },
70
+ {
71
+ q4paConvSaisi: undefined,
72
+ enumPeriodeConstructionId: '1',
73
+ surfaceIsolee: 200,
74
+ surfaceNonIsolee: 300,
75
+ surfaceMenuiserieAvecJoint: 100,
76
+ surfaceMenuiserieSansJoint: 200,
77
+ expectedIsolationSurface: '0',
78
+ expectedPresenceJointsMenuiserie: undefined
79
+ },
80
+ {
81
+ q4paConvSaisi: undefined,
82
+ enumPeriodeConstructionId: '2',
83
+ surfaceIsolee: 200,
84
+ surfaceNonIsolee: 100,
85
+ surfaceMenuiserieAvecJoint: 0,
86
+ surfaceMenuiserieSansJoint: 0,
87
+ expectedIsolationSurface: '1',
88
+ expectedPresenceJointsMenuiserie: undefined
89
+ },
90
+ {
91
+ q4paConvSaisi: undefined,
92
+ enumPeriodeConstructionId: '3',
93
+ surfaceIsolee: 200,
94
+ surfaceNonIsolee: 100,
95
+ surfaceMenuiserieAvecJoint: 0,
96
+ surfaceMenuiserieSansJoint: 0,
97
+ expectedIsolationSurface: undefined,
98
+ expectedPresenceJointsMenuiserie: undefined
99
+ },
100
+ {
101
+ q4paConvSaisi: 12.5,
102
+ enumPeriodeConstructionId: '1',
103
+ surfaceIsolee: 0,
104
+ surfaceNonIsolee: 0,
105
+ surfaceMenuiserieAvecJoint: 0,
106
+ surfaceMenuiserieSansJoint: 0,
107
+ expectedIsolationSurface: '0',
108
+ expectedPresenceJointsMenuiserie: undefined
109
+ }
110
+ ])(
111
+ '$q4paConvSaisi: q4paConvSaisi, $enumPeriodeConstructionId: enumPeriodeConstructionId, $surfaceIsolee: surfaceIsolee,' +
112
+ '$surfaceNonIsolee: surfaceNonIsolee, $surfaceMenuiserieAvecJoint: surfaceMenuiserieAvecJoint, $surfaceMenuiserieSansJoint: surfaceMenuiserieSansJoint,' +
113
+ '$expectedIsolationSurface: expectedIsolationSurface, $expectedPresenceJointsMenuiserie: expectedPresenceJointsMenuiserie',
114
+ ({
115
+ q4paConvSaisi,
116
+ enumPeriodeConstructionId,
117
+ surfaceIsolee,
118
+ surfaceNonIsolee,
119
+ surfaceMenuiserieAvecJoint,
120
+ surfaceMenuiserieSansJoint,
121
+ expectedIsolationSurface,
122
+ expectedPresenceJointsMenuiserie
123
+ }) => {
124
+ vi.spyOn(tvStore, 'getQ4paConv').mockReturnValue({ q4pa_conv: 18.8 });
125
+ ctx.enumPeriodeConstructionId = enumPeriodeConstructionId;
126
+
127
+ /** @type {VentilationDE} */
128
+ const de = {
129
+ q4pa_conv_saisi: q4paConvSaisi
130
+ };
131
+
132
+ const q4paConv = service.q4paConv(
133
+ de,
134
+ ctx,
135
+ surfaceIsolee,
136
+ surfaceNonIsolee,
137
+ surfaceMenuiserieAvecJoint,
138
+ surfaceMenuiserieSansJoint
139
+ );
140
+
141
+ if (q4paConvSaisi) {
142
+ expect(tvStore.getQ4paConv).not.toHaveBeenCalled();
143
+ expect(q4paConv).toBe(q4paConvSaisi);
144
+ } else {
145
+ expect(tvStore.getQ4paConv).toHaveBeenCalledWith(
146
+ enumPeriodeConstructionId,
147
+ TypeHabitation.MAISON,
148
+ expectedIsolationSurface,
149
+ expectedPresenceJointsMenuiserie
150
+ );
151
+ expect(q4paConv).toBe(18.8);
152
+ }
153
+ }
154
+ );
155
+
156
+ test('calcul de hvent', () => {
157
+ expect(service.hvent(108, { qvarep_conv: 10 })).toBeCloseTo(367.2, 2);
158
+ });
159
+ });
160
+
161
+ describe('Determination de hperm', () => {
162
+ /** @type {Contexte} */
163
+ let ctx = { typeHabitation: TypeHabitation.MAISON, surfaceHabitable: 100 };
164
+
165
+ test.each([
166
+ { plusieursFacadeExposee: false, expectedHperm: 15.04 },
167
+ { plusieursFacadeExposee: true, expectedHperm: 98.97 }
168
+ ])(
169
+ '$plusieursFacadeExposee: plusieursFacadeExposee, $expectedHperm: expectedHperm',
170
+ ({ plusieursFacadeExposee, expectedHperm }) => {
171
+ ctx.hauteurSousPlafond = 10;
172
+
173
+ /** @type {VentilationDE} */
174
+ const de = {
175
+ plusieurs_facade_exposee: plusieursFacadeExposee
176
+ };
177
+
178
+ const hperm = service.hperm(
179
+ de,
180
+ { smea_conv: 18, qvasouf_conv: 15.3, qvarep_conv: 13.2 },
181
+ ctx,
182
+ 10.5,
183
+ 19.6
184
+ );
185
+ expect(hperm).toBeCloseTo(expectedHperm, 2);
186
+ }
187
+ );
188
+ });
189
+
190
+ describe('Determination de pventMoy', () => {
191
+ test.each([
192
+ {
193
+ label: 'Ventilation par ouverture des fenêtres',
194
+ typeVentilation: '1',
195
+ typeHabitation: TypeHabitation.MAISON,
196
+ ventilationPost2012: true,
197
+ surfaceHabitable: 100,
198
+ qvarepConv: 10,
199
+ expectedPventMoy: 0
200
+ },
201
+ {
202
+ label: 'Ventilation naturelle par conduit',
203
+ typeVentilation: '25',
204
+ typeHabitation: TypeHabitation.APPARTEMENT,
205
+ ventilationPost2012: false,
206
+ surfaceHabitable: 100,
207
+ qvarepConv: 10,
208
+ expectedPventMoy: 0
209
+ },
210
+ {
211
+ label: 'Ventilation Simple flux auto SF AUTO',
212
+ typeVentilation: '4',
213
+ typeHabitation: TypeHabitation.MAISON,
214
+ ventilationPost2012: true,
215
+ surfaceHabitable: 100,
216
+ qvarepConv: 10,
217
+ expectedPventMoy: 35
218
+ },
219
+ {
220
+ label: 'Ventilation Simple flux auto SF AUTO',
221
+ typeVentilation: '4',
222
+ typeHabitation: TypeHabitation.MAISON,
223
+ ventilationPost2012: false,
224
+ surfaceHabitable: 100,
225
+ qvarepConv: 10,
226
+ expectedPventMoy: 65
227
+ },
228
+ {
229
+ label: 'Ventilation Simple flux auto SF AUTO',
230
+ typeVentilation: '4',
231
+ typeHabitation: TypeHabitation.APPARTEMENT,
232
+ ventilationPost2012: true,
233
+ surfaceHabitable: 100,
234
+ qvarepConv: 10,
235
+ expectedPventMoy: 250
236
+ },
237
+ {
238
+ label: 'Ventilation Simple flux auto SF AUTO',
239
+ typeVentilation: '4',
240
+ typeHabitation: TypeHabitation.APPARTEMENT,
241
+ ventilationPost2012: false,
242
+ surfaceHabitable: 100,
243
+ qvarepConv: 10,
244
+ expectedPventMoy: 460
245
+ },
246
+ {
247
+ label: 'Ventilation Simple flux auto SF GAZ',
248
+ typeVentilation: '10',
249
+ typeHabitation: TypeHabitation.MAISON,
250
+ ventilationPost2012: true,
251
+ surfaceHabitable: 100,
252
+ qvarepConv: 10,
253
+ expectedPventMoy: 35
254
+ },
255
+ {
256
+ label: 'Ventilation Simple flux auto SF GAZ',
257
+ typeVentilation: '11',
258
+ typeHabitation: TypeHabitation.MAISON,
259
+ ventilationPost2012: false,
260
+ surfaceHabitable: 100,
261
+ qvarepConv: 10,
262
+ expectedPventMoy: 65
263
+ },
264
+ {
265
+ label: 'Ventilation Simple flux auto SF GAZ',
266
+ typeVentilation: '10',
267
+ typeHabitation: TypeHabitation.APPARTEMENT,
268
+ ventilationPost2012: true,
269
+ surfaceHabitable: 100,
270
+ qvarepConv: 10,
271
+ expectedPventMoy: 250
272
+ },
273
+ {
274
+ label: 'Ventilation Simple flux auto SF GAZ',
275
+ typeVentilation: '12',
276
+ typeHabitation: TypeHabitation.APPARTEMENT,
277
+ ventilationPost2012: false,
278
+ surfaceHabitable: 100,
279
+ qvarepConv: 10,
280
+ expectedPventMoy: 460
281
+ },
282
+ {
283
+ label: 'Ventilation Simple flux hygro SF HYGRO',
284
+ typeVentilation: '7',
285
+ typeHabitation: TypeHabitation.MAISON,
286
+ ventilationPost2012: true,
287
+ surfaceHabitable: 100,
288
+ qvarepConv: 10,
289
+ expectedPventMoy: 15
290
+ },
291
+ {
292
+ label: 'Ventilation Simple flux hygro SF HYGRO',
293
+ typeVentilation: '8',
294
+ typeHabitation: TypeHabitation.MAISON,
295
+ ventilationPost2012: false,
296
+ surfaceHabitable: 100,
297
+ qvarepConv: 10,
298
+ expectedPventMoy: 50
299
+ },
300
+ {
301
+ label: 'Ventilation Simple flux hygro SF HYGRO',
302
+ typeVentilation: '9',
303
+ typeHabitation: TypeHabitation.APPARTEMENT,
304
+ ventilationPost2012: true,
305
+ surfaceHabitable: 100,
306
+ qvarepConv: 10,
307
+ expectedPventMoy: 250
308
+ },
309
+ {
310
+ label: 'Ventilation Simple flux hygro SF HYGRO',
311
+ typeVentilation: '13',
312
+ typeHabitation: TypeHabitation.APPARTEMENT,
313
+ ventilationPost2012: false,
314
+ surfaceHabitable: 100,
315
+ qvarepConv: 10,
316
+ expectedPventMoy: 460
317
+ },
318
+ {
319
+ label: 'Ventilation double flux hygro DF INDIVIDUELLE',
320
+ typeVentilation: '19',
321
+ typeHabitation: TypeHabitation.MAISON,
322
+ ventilationPost2012: true,
323
+ surfaceHabitable: 100,
324
+ qvarepConv: 10,
325
+ expectedPventMoy: 35
326
+ },
327
+ {
328
+ label: 'Ventilation double flux hygro DF INDIVIDUELLE',
329
+ typeVentilation: '19',
330
+ typeHabitation: TypeHabitation.MAISON,
331
+ ventilationPost2012: false,
332
+ surfaceHabitable: 100,
333
+ qvarepConv: 10,
334
+ expectedPventMoy: 80
335
+ },
336
+ {
337
+ label: 'Ventilation double flux hygro DF INDIVIDUELLE',
338
+ typeVentilation: '19',
339
+ typeHabitation: TypeHabitation.APPARTEMENT,
340
+ ventilationPost2012: true,
341
+ surfaceHabitable: 100,
342
+ qvarepConv: 10,
343
+ expectedPventMoy: 600
344
+ },
345
+ {
346
+ label: 'Ventilation double flux hygro DF INDIVIDUELLE',
347
+ typeVentilation: '19',
348
+ typeHabitation: TypeHabitation.APPARTEMENT,
349
+ ventilationPost2012: false,
350
+ surfaceHabitable: 100,
351
+ qvarepConv: 10,
352
+ expectedPventMoy: 1100
353
+ },
354
+ {
355
+ label: 'Ventilation simple flux auto HYBRIDE',
356
+ typeVentilation: '26',
357
+ typeHabitation: TypeHabitation.MAISON,
358
+ ventilationPost2012: true,
359
+ surfaceHabitable: 100,
360
+ qvarepConv: 10,
361
+ expectedPventMoy: 2.92
362
+ },
363
+ {
364
+ label: 'Ventilation simple flux auto HYBRIDE',
365
+ typeVentilation: '27',
366
+ typeHabitation: TypeHabitation.MAISON,
367
+ ventilationPost2012: false,
368
+ surfaceHabitable: 100,
369
+ qvarepConv: 10,
370
+ expectedPventMoy: 5.42
371
+ },
372
+ {
373
+ label: 'Ventilation simple flux auto HYBRIDE',
374
+ typeVentilation: '28',
375
+ typeHabitation: TypeHabitation.APPARTEMENT,
376
+ ventilationPost2012: true,
377
+ surfaceHabitable: 100,
378
+ qvarepConv: 10,
379
+ expectedPventMoy: 41.67
380
+ },
381
+ {
382
+ label: 'Ventilation simple flux auto HYBRIDE',
383
+ typeVentilation: '29',
384
+ typeHabitation: TypeHabitation.APPARTEMENT,
385
+ ventilationPost2012: false,
386
+ surfaceHabitable: 100,
387
+ qvarepConv: 10,
388
+ expectedPventMoy: 76.67
389
+ }
390
+ ])(
391
+ '$typeVentilation: typeVentilation, $typeHabitation: typeHabitation, $ventilationPost2012: ventilationPost2012, $surfaceHabitable: surfaceHabitable, $qvarepConv: qvarepConv',
392
+ ({
393
+ typeVentilation,
394
+ typeHabitation,
395
+ ventilationPost2012,
396
+ surfaceHabitable,
397
+ qvarepConv,
398
+ expectedPventMoy
399
+ }) => {
400
+ const pventMoy = service.pventMoy(
401
+ typeVentilation,
402
+ { typeHabitation, surfaceHabitable },
403
+ ventilationPost2012,
404
+ { qvarep_conv: qvarepConv }
405
+ );
406
+ expect(pventMoy).toBeCloseTo(expectedPventMoy, 2);
407
+ }
408
+ );
409
+ });
410
+
411
+ describe("Test d'intégration des ventilations", () => {
412
+ test.each(corpus)('vérification des DI de la ventilation pour dpe %s', (ademeId) => {
413
+ let dpeRequest = getAdemeFileJson(ademeId);
414
+ dpeRequest = normalizerService.normalize(dpeRequest);
415
+
416
+ const initialVentilations = [
417
+ ...(dpeRequest.logement.ventilation_collection?.ventilation || [])
418
+ ];
419
+
420
+ /** @type {Contexte} */
421
+ const ctx = contexteBuilder.fromDpe(dpeRequest);
422
+
423
+ deperditionEnveloppeService.deperditions(ctx, dpeRequest.logement);
424
+
425
+ const ventilations = dpeRequest.logement.ventilation_collection?.ventilation || [];
426
+
427
+ ventilations.forEach((ventilation, index) => {
428
+ expect(initialVentilations[index].donnee_intermediaire.hvent).toBeCloseTo(
429
+ ventilation.donnee_intermediaire.hvent,
430
+ 2
431
+ );
432
+ expect(initialVentilations[index].donnee_intermediaire.hperm).toBeCloseTo(
433
+ ventilation.donnee_intermediaire.hperm,
434
+ 2
435
+ );
436
+ expect(
437
+ initialVentilations[index].donnee_intermediaire.conso_auxiliaire_ventilation
438
+ ).toBeCloseTo(ventilation.donnee_intermediaire.conso_auxiliaire_ventilation, 2);
439
+ });
440
+ });
441
+ });
442
+ });
@@ -0,0 +1,10 @@
1
+ import { TypeHabitation } from '../../../dpe/domain/models/dpe.model';
2
+
3
+ export interface Contexte {
4
+ typeHabitation: TypeHabitation;
5
+ enumPeriodeConstructionId: string;
6
+ surfaceHabitable: string;
7
+ hauteurSousPlafond: string;
8
+ zoneClimatiqueId: string;
9
+ effetJoule: boolean;
10
+ }
@@ -0,0 +1,8 @@
1
+ export interface DeperditionData {
2
+ enumTypeAdjacenceId?: string;
3
+ surfaceAiu?: number;
4
+ surfaceAue?: number;
5
+ enumCfgIsolationLncId?: string;
6
+ tvCoefReductionDeperditionId?: string;
7
+ zoneClimatiqueId?: string;
8
+ }
@@ -0,0 +1,24 @@
1
+ import { DpePreProcessor } from '../../../../../preprocessor/index.js';
2
+
3
+ /**
4
+ * Service de normalisation du DPE d'entrée
5
+ * Permet de redresser / complèter des données d'entrées
6
+ */
7
+ export class DpeNormalizerService {
8
+ /**
9
+ * @param dpe {Dpe}
10
+ * @return {Dpe} Normalized DPE
11
+ */
12
+ normalize(dpe) {
13
+ /**
14
+ * On clone le DPE d'origine pour ne pas le modifier
15
+ * @type {Dpe}
16
+ */
17
+ let normalizedDpe = JSON.parse(JSON.stringify(dpe));
18
+
19
+ const dpePreProcessor = new DpePreProcessor();
20
+ dpePreProcessor.preprocess(normalizedDpe);
21
+
22
+ return normalizedDpe;
23
+ }
24
+ }
@@ -0,0 +1,3 @@
1
+ import { describe } from 'vitest';
2
+
3
+ describe.skip('Normalisation des DPE', () => {});
@@ -1,4 +1,5 @@
1
1
  import getFicheTechnique from './ficheTechnique.js';
2
+ import { describe, expect, test } from 'vitest';
2
3
 
3
4
  describe('FicheTechnique service tests', () => {
4
5
  const dpe = {
@@ -119,7 +120,7 @@ describe('FicheTechnique service tests', () => {
119
120
  }
120
121
  };
121
122
 
122
- it('should return a fiche technique', async () => {
123
+ test('should return a fiche technique', async () => {
123
124
  let fiche = getFicheTechnique(dpe, '10', 'exposées');
124
125
  expect(fiche).not.toBeNull();
125
126
  expect(fiche.description).toBe('Façades exposées: plusieurs');
@@ -148,14 +149,14 @@ describe('FicheTechnique service tests', () => {
148
149
  expect(fiche).not.toBeNull();
149
150
  });
150
151
 
151
- it('should return a fiche technique with multiple criteria', async () => {
152
+ test('should return a fiche technique with multiple criteria', async () => {
152
153
  let fiche = getFicheTechnique(dpe, '10', 'exposées', [1950, 'Gaz']);
153
154
  expect(fiche).not.toBeNull();
154
155
  expect(fiche.description).toBe('Façades exposées: plusieurs');
155
156
  expect(fiche.valeur).toBe('aucune');
156
157
  });
157
158
 
158
- it('should not return a non existing fiche technique', async () => {
159
+ test('should not return a non existing fiche technique', async () => {
159
160
  let fiche = getFicheTechnique(dpe, '40', 'exposées');
160
161
  expect(fiche).toBeNull();
161
162
 
package/output.js ADDED
@@ -0,0 +1 @@
1
+ filecontent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open3cl/engine",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Open Source 3CL-DPE engine",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -12,7 +12,8 @@
12
12
  "access": "public"
13
13
  },
14
14
  "scripts": {
15
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
15
+ "test": "vitest run",
16
+ "test:ci": "vitest run --coverage",
16
17
  "test:benchmark": "node inspect test/run_benchmark.js",
17
18
  "qa:lint": "eslint .",
18
19
  "qa:lint:fix": "npm run qa:lint -- --fix",
@@ -32,9 +33,10 @@
32
33
  "3cl"
33
34
  ],
34
35
  "dependencies": {
35
- "@jest/globals": "^29.7.0",
36
+ "dioma": "^0.4.6",
36
37
  "fast-xml-parser": "^4.5.0",
37
- "lodash": "^4.17.21"
38
+ "lodash": "^4.17.21",
39
+ "winston": "3.13.0"
38
40
  },
39
41
  "devDependencies": {
40
42
  "@commitlint/cli": "^19.2.1",
@@ -43,8 +45,8 @@
43
45
  "@semantic-release/changelog": "^6.0.3",
44
46
  "@semantic-release/git": "^10.0.1",
45
47
  "@semantic-release/github": "^10.0.2",
46
- "@types/jest": "^29.5.12",
47
48
  "@types/node": "^20.12.4",
49
+ "@vitest/coverage-v8": "^3.0.6",
48
50
  "deep-object-diff": "^1.1.9",
49
51
  "eslint": "^8.57.0",
50
52
  "eslint-config-prettier": "^9.1.0",
@@ -54,15 +56,14 @@
54
56
  "eslint-plugin-n": "^16.6.2",
55
57
  "eslint-plugin-promise": "^6.1.1",
56
58
  "husky": "^9.0.11",
57
- "jest": "^29.7.0",
58
- "jest-html-reporter": "^3.10.2",
59
59
  "jscpd": "^3.5.10",
60
60
  "prettier": "^3.2.5",
61
61
  "pretty-quick": "^4.0.0",
62
62
  "semantic-release": "^23.0.6",
63
+ "vitest": "3.0.6",
63
64
  "xlsx": "^0.18.5"
64
65
  },
65
- "author": "Jack Halford",
66
+ "author": "Open3Cl",
66
67
  "license": "GPL-3.0",
67
68
  "bugs": {
68
69
  "url": "https://github.com/Open3CL/engine/issues"