@open3cl/engine 1.0.7 → 1.0.9
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/baie-vitree.model.ts +8 -6
- package/features/dpe/domain/models/dpe.model.ts +7 -3
- package/features/dpe/domain/models/{plancher-bas.model.ts → plancher.model.ts} +31 -7
- package/features/dpe/infrastructure/baieVitreeTv.store.js +292 -0
- package/features/dpe/infrastructure/baieVitreeTv.store.spec.js +352 -0
- package/features/dpe/infrastructure/pontThermiqueTv.store.js +112 -0
- package/features/dpe/infrastructure/pontThermiqueTv.store.spec.js +134 -0
- package/features/dpe/infrastructure/tv.store.js +0 -33
- package/features/dpe/infrastructure/tv.store.spec.js +0 -83
- package/features/engine/domain/engine.service.js +2 -1
- package/features/engine/domain/enveloppe/baie_vitree/deperdition-baie-vitree.service.js +292 -0
- package/features/engine/domain/enveloppe/baie_vitree/deperdition-baie-vitree.service.spec.js +484 -0
- package/features/engine/domain/enveloppe/deperdition-enveloppe.service.js +38 -0
- package/features/engine/domain/enveloppe/mur/deperdition-mur.service.js +28 -0
- package/features/engine/domain/enveloppe/mur/deperdition-mur.service.spec.js +61 -0
- package/features/engine/domain/enveloppe/plancher_bas/deperdition-plancher-bas.service.js +46 -0
- package/features/engine/domain/enveloppe/plancher_bas/deperdition-plancher-bas.service.spec.js +85 -0
- package/features/engine/domain/enveloppe/plancher_haut/deperdition-plancher-haut.service.js +33 -0
- package/features/engine/domain/enveloppe/plancher_haut/deperdition-plancher-haut.service.spec.js +61 -0
- package/features/engine/domain/enveloppe/pont_thermique/deperdition-pont-thermique.service.js +439 -0
- package/features/engine/domain/enveloppe/pont_thermique/deperdition-pont-thermique.service.spec.js +636 -0
- package/features/engine/domain/enveloppe/ventilation/deperdition-ventilation.service.spec.js +49 -0
- package/package.json +1 -1
- package/features/dpe/domain/models/plancher-haut.model.ts +0 -33
package/features/engine/domain/enveloppe/ventilation/deperdition-ventilation.service.spec.js
CHANGED
|
@@ -2,10 +2,24 @@ import { TvStore } from '../../../../dpe/infrastructure/tv.store.js';
|
|
|
2
2
|
import { DeperditionVentilationService } from './deperdition-ventilation.service.js';
|
|
3
3
|
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
|
4
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';
|
|
5
10
|
|
|
6
11
|
/** @type {DeperditionVentilationService} **/
|
|
7
12
|
let service;
|
|
8
13
|
|
|
14
|
+
/** @type {DpeNormalizerService} **/
|
|
15
|
+
let normalizerService;
|
|
16
|
+
|
|
17
|
+
/** @type {DeperditionEnveloppeService} **/
|
|
18
|
+
let deperditionEnveloppeService;
|
|
19
|
+
|
|
20
|
+
/** @type {ContexteBuilder} **/
|
|
21
|
+
let contexteBuilder;
|
|
22
|
+
|
|
9
23
|
/** @type {TvStore} **/
|
|
10
24
|
let tvStore;
|
|
11
25
|
|
|
@@ -13,6 +27,9 @@ describe('Calcul de déperdition des portes', () => {
|
|
|
13
27
|
beforeEach(() => {
|
|
14
28
|
tvStore = new TvStore();
|
|
15
29
|
service = new DeperditionVentilationService(tvStore);
|
|
30
|
+
normalizerService = new DpeNormalizerService();
|
|
31
|
+
contexteBuilder = new ContexteBuilder();
|
|
32
|
+
deperditionEnveloppeService = new DeperditionEnveloppeService();
|
|
16
33
|
});
|
|
17
34
|
|
|
18
35
|
describe('Determination de q4paConv', () => {
|
|
@@ -390,4 +407,36 @@ describe('Calcul de déperdition des portes', () => {
|
|
|
390
407
|
}
|
|
391
408
|
);
|
|
392
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
|
+
});
|
|
393
442
|
});
|
package/package.json
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { DE } from './dpe.model';
|
|
2
|
-
|
|
3
|
-
export interface PlancherHaut {
|
|
4
|
-
donnee_entree?: PlancherHautDE;
|
|
5
|
-
donnee_intermediaire?: PlancherHautDI;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface PlancherHautDE extends DE {
|
|
9
|
-
reference_lnc?: string;
|
|
10
|
-
tv_coef_reduction_deperdition_id?: string; // TV
|
|
11
|
-
surface_aiu?: number;
|
|
12
|
-
surface_aue?: number;
|
|
13
|
-
enum_cfg_isolation_lnc_id?: string; // ENUM cfg_isolation_lnc
|
|
14
|
-
enum_type_adjacence_id?: string; // ENUM type_adjacence
|
|
15
|
-
surface_paroi_opaque?: number;
|
|
16
|
-
uph0_saisi?: number;
|
|
17
|
-
tv_uph0_id?: string; // TV
|
|
18
|
-
enum_type_plancher_haut_id?: string; // ENUM type_plancher_bas
|
|
19
|
-
enum_methode_saisie_u0_id?: string; // ENUM methode_saisie_u0
|
|
20
|
-
uph_saisi?: number;
|
|
21
|
-
enum_type_isolation_id?: string; // ENUM type_isolation
|
|
22
|
-
enum_periode_isolation_id?: string; // ENUM periode_isolation
|
|
23
|
-
resistance_isolation?: number;
|
|
24
|
-
epaisseur_isolation?: number;
|
|
25
|
-
tv_uph_id?: string; // TV
|
|
26
|
-
enum_methode_saisie_u_id?: string; // ENUM methode_saisie_u
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface PlancherHautDI {
|
|
30
|
-
uph: number;
|
|
31
|
-
uph0: number;
|
|
32
|
-
b: number;
|
|
33
|
-
}
|