@open3cl/engine 1.0.8 → 1.0.10

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 (35) hide show
  1. package/features/dpe/domain/models/dpe.model.ts +7 -3
  2. package/features/dpe/domain/models/{plancher-bas.model.ts → plancher.model.ts} +31 -7
  3. package/features/dpe/domain/models/type-habitation.model.js +8 -0
  4. package/features/dpe/infrastructure/baieVitreeTv.store.js +70 -0
  5. package/features/dpe/infrastructure/baieVitreeTv.store.spec.js +106 -0
  6. package/features/dpe/infrastructure/pontThermiqueTv.store.js +112 -0
  7. package/features/dpe/infrastructure/pontThermiqueTv.store.spec.js +134 -0
  8. package/features/engine/domain/contexte.builder.js +59 -63
  9. package/features/engine/domain/contexte.builder.spec.js +41 -62
  10. package/features/engine/domain/engine.service.js +20 -2
  11. package/features/engine/domain/enveloppe/baie_vitree/deperdition-baie-vitree.service.js +1 -1
  12. package/features/engine/domain/enveloppe/deperdition-enveloppe.service.js +41 -0
  13. package/features/engine/domain/enveloppe/deperdition-enveloppe.service.spec.js +3 -3
  14. package/features/engine/domain/enveloppe/deperdition.service.js +2 -3
  15. package/features/engine/domain/enveloppe/espace_tampon/espace-tampon.service.js +44 -0
  16. package/features/engine/domain/enveloppe/espace_tampon/espace-tampon.service.spec.js +81 -0
  17. package/features/engine/domain/enveloppe/mur/deperdition-mur.service.js +31 -3
  18. package/features/engine/domain/enveloppe/mur/deperdition-mur.service.spec.js +91 -10
  19. package/features/engine/domain/enveloppe/plancher_bas/deperdition-plancher-bas.service.js +48 -2
  20. package/features/engine/domain/enveloppe/plancher_bas/deperdition-plancher-bas.service.spec.js +103 -6
  21. package/features/engine/domain/enveloppe/plancher_haut/deperdition-plancher-haut.service.js +35 -2
  22. package/features/engine/domain/enveloppe/plancher_haut/deperdition-plancher-haut.service.spec.js +82 -7
  23. package/features/engine/domain/enveloppe/pont_thermique/deperdition-pont-thermique.service.js +439 -0
  24. package/features/engine/domain/enveloppe/pont_thermique/deperdition-pont-thermique.service.spec.js +636 -0
  25. package/features/engine/domain/enveloppe/porte/deperdition-porte.service.js +1 -1
  26. package/features/engine/domain/enveloppe/porte/deperdition-porte.service.spec.js +2 -2
  27. package/features/engine/domain/enveloppe/ventilation/deperdition-ventilation.service.js +1 -1
  28. package/features/engine/domain/logement/nadeq.service.js +62 -0
  29. package/features/engine/domain/logement/nadeq.service.spec.js +71 -0
  30. package/features/engine/domain/logement/surface-sud-equivalente.service.js +169 -0
  31. package/features/engine/domain/logement/surface-sud-equivalente.service.spec.js +210 -0
  32. package/features/engine/domain/models/contexte.model.ts +10 -5
  33. package/features/engine/domain/models/deperdition.model.ts +1 -1
  34. package/package.json +1 -1
  35. package/features/dpe/domain/models/plancher-haut.model.ts +0 -33
@@ -0,0 +1,62 @@
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 ctx {Contexte}
14
+ * @param bv {BaieVitree}
15
+ * @return {number}
16
+ */
17
+ execute(ctx) {
18
+ if (ctx.typeDpe === TypeDpe.MAISON) {
19
+ return this.#calculateIndividualNadeq(ctx.surfaceHabitable);
20
+ }
21
+
22
+ return this.#calculateCollectiveNadeq(
23
+ ctx.surfaceHabitable,
24
+ ctx.typeDpe === TypeDpe.APPARTEMENT ? 1 : ctx.nombreAppartement
25
+ );
26
+ }
27
+
28
+ /**
29
+ * Calcul de nadeq pour une maison ou un logement individuel
30
+ * @param surfaceHabitableLogement {number}
31
+ * @returns {number}
32
+ */
33
+ #calculateIndividualNadeq(surfaceHabitableLogement) {
34
+ let Nmax;
35
+
36
+ if (surfaceHabitableLogement < 30) Nmax = 1;
37
+ else if (surfaceHabitableLogement < 70) Nmax = 1.75 - 0.01875 * (70 - surfaceHabitableLogement);
38
+ else Nmax = 0.025 * surfaceHabitableLogement;
39
+
40
+ if (Nmax < 1.75) return Nmax;
41
+ else return 1.75 + 0.3 * (Nmax - 1.75);
42
+ }
43
+
44
+ /**
45
+ * Calcul de nadeq pour un logement collectif
46
+ *
47
+ * @param surfaceHabitableImmeuble {number}
48
+ * @param nombreAppartement {number}
49
+ * @returns {number}
50
+ */
51
+ #calculateCollectiveNadeq(surfaceHabitableImmeuble, nombreAppartement) {
52
+ const Shmoy = surfaceHabitableImmeuble / nombreAppartement;
53
+
54
+ let Nmax;
55
+ if (Shmoy < 10) Nmax = 1;
56
+ else if (Shmoy < 50) Nmax = 1.75 - 0.01875 * (50 - Shmoy);
57
+ else Nmax = 0.035 * Shmoy;
58
+
59
+ if (Nmax < 1.75) return nombreAppartement * Nmax;
60
+ else return nombreAppartement * (1.75 + 0.3 * (Nmax - 1.75));
61
+ }
62
+ }
@@ -0,0 +1,71 @@
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
+ const ctx = {
22
+ surfaceHabitable: surfaceHabitable,
23
+ typeDpe: TypeDpe.MAISON
24
+ };
25
+ expect(service.execute(ctx)).toBe(expectedNadeq);
26
+ }
27
+ );
28
+
29
+ test.each([
30
+ { surfaceHabitable: 8, expectedNadeq: 1 },
31
+ { surfaceHabitable: 28, expectedNadeq: 1.3375 },
32
+ { surfaceHabitable: 45, expectedNadeq: 1.65625 },
33
+ { surfaceHabitable: 51, expectedNadeq: 1.7605 },
34
+ { surfaceHabitable: 70, expectedNadeq: 1.96 },
35
+ { surfaceHabitable: 75, expectedNadeq: 2.0125 }
36
+ ])(
37
+ `Typologie APPARTEMENT : Nombre d'adultes équivalent $expectedNadeq pour une surface de logement $surfaceHabitable`,
38
+ ({ expectedNadeq, surfaceHabitable }) => {
39
+ const ctx = {
40
+ surfaceHabitable: surfaceHabitable,
41
+ typeDpe: TypeDpe.APPARTEMENT
42
+ };
43
+ expect(service.execute(ctx)).toBeCloseTo(expectedNadeq, 2);
44
+ }
45
+ );
46
+
47
+ test.each([
48
+ { surfaceHabitable: 8, expectedNadeq: 1, nombreAppartement: 1 },
49
+ { surfaceHabitable: 8, expectedNadeq: 2, nombreAppartement: 2 },
50
+ { surfaceHabitable: 28, expectedNadeq: 1.3375, nombreAppartement: 1 },
51
+ { surfaceHabitable: 28, expectedNadeq: 2.15, nombreAppartement: 2 },
52
+ { surfaceHabitable: 45, expectedNadeq: 1.65625, nombreAppartement: 1 },
53
+ { surfaceHabitable: 45, expectedNadeq: 2.46875, nombreAppartement: 2 },
54
+ { surfaceHabitable: 51, expectedNadeq: 1.7605, nombreAppartement: 1 },
55
+ { surfaceHabitable: 51, expectedNadeq: 2.58125, nombreAppartement: 2 },
56
+ { surfaceHabitable: 70, expectedNadeq: 1.96, nombreAppartement: 1 },
57
+ { surfaceHabitable: 70, expectedNadeq: 2.9375, nombreAppartement: 2 },
58
+ { surfaceHabitable: 75, expectedNadeq: 2.0125, nombreAppartement: 1 },
59
+ { surfaceHabitable: 75, expectedNadeq: 3.03125, nombreAppartement: 2 }
60
+ ])(
61
+ `Typologie IMMEUBLE : Nombre d'adultes équivalent $expectedNadeq pour une surface de logement $surfaceHabitable et un nombre d'apartement $nombreAppartement`,
62
+ ({ expectedNadeq, surfaceHabitable, nombreAppartement }) => {
63
+ const ctx = {
64
+ surfaceHabitable: surfaceHabitable,
65
+ nombreAppartement: nombreAppartement,
66
+ typeDpe: TypeDpe.IMMEUBLE
67
+ };
68
+ expect(service.execute(ctx)).toBeCloseTo(expectedNadeq, 2);
69
+ }
70
+ );
71
+ });
@@ -0,0 +1,169 @@
1
+ import { mois_liste } from '../../../../utils.js';
2
+ import { inject } from 'dioma';
3
+ import { BaieVitreeTvStore } from '../../../dpe/infrastructure/baieVitreeTv.store.js';
4
+
5
+ /**
6
+ * Calcul e la surface sud équivalente du logement
7
+ * Chapitre 6.2 Détermination de la surface Sud équivalente
8
+ *
9
+ * Methode_de_calcul_3CL_DPE_2021 - Page 45
10
+ * Octobre 2021
11
+ * @see consolide_anne…arrete_du_31_03_2021_relatif_aux_methodes_et_procedures_applicables.pdf
12
+ */
13
+ export class SurfaceSudEquivalenteService {
14
+ /**
15
+ * @type {BaieVitreeTvStore}
16
+ */
17
+ #tvStore;
18
+
19
+ /**
20
+ * @param tvStore {BaieVitreeTvStore}
21
+ */
22
+ constructor(tvStore = inject(BaieVitreeTvStore)) {
23
+ this.#tvStore = tvStore;
24
+ }
25
+
26
+ /**
27
+ * @param ctx {Contexte}
28
+ * @param enveloppe {Enveloppe}
29
+ * @return {number}
30
+ */
31
+ execute(ctx, enveloppe) {
32
+ const baiesVitrees = enveloppe.baie_vitree_collection?.baie_vitree || [];
33
+ const ets = enveloppe.ets_collection?.ets || [];
34
+
35
+ return mois_liste.reduce((acc, mois) => acc + this.ssdMois(ctx, baiesVitrees, ets, mois), 0);
36
+ }
37
+
38
+ /**
39
+ * Calcul de la surface sud du logement pour un mois donné
40
+ *
41
+ * @param ctx {Contexte}
42
+ * @param baiesVitrees {BaieVitree[]}
43
+ * @param ets {Ets}
44
+ * @param mois {string}
45
+ * @returns {number}
46
+ */
47
+ ssdMois(ctx, baiesVitrees, ets, mois) {
48
+ let SseVerandaj = 0;
49
+
50
+ /**
51
+ * Si une véranda est présente, on calcul l'mpact de l’espace tampon solarisé sur les apports solaires à travers
52
+ * les baies vitrées qui séparent le logement de l'espace tampon
53
+ *
54
+ * 6.3 Traitement des espaces tampons solarisés
55
+ * 10 - 'espace tampon solarisé (véranda,loggia fermée)'
56
+ */
57
+ if (ets) {
58
+ // Certaines vérandas sont dupliqués dans les DPE.
59
+ if (Array.isArray(ets)) {
60
+ ets = ets[0];
61
+ }
62
+
63
+ if (ets) {
64
+ const bver = ets.donnee_intermediaire.bver;
65
+ const T = ets.donnee_intermediaire.coef_transparence_ets;
66
+
67
+ /**
68
+ * Surface sud équivalente représentant l’impact des apports solaires associés au rayonnement solaire
69
+ * traversant directement l’espace tampon pour arriver dans la partie habitable du logement
70
+ * Calculés pour les baies vitrées qui séparent le logement de l'espace tampon
71
+ * @type {number}
72
+ */
73
+ const Ssdj = this.getBaiesSurEspaceTampon(baiesVitrees).reduce((acc, bv) => {
74
+ return acc + T * this.ssdBaieMois(bv, ctx.zoneClimatique.id, mois);
75
+ }, 0);
76
+
77
+ /**
78
+ * Surface sud équivalente représentant les apports solaires indirects dans le logement
79
+ */
80
+ let baies = ets.baie_ets_collection.baie_ets;
81
+
82
+ if (!Array.isArray(baies)) {
83
+ baies = [baies];
84
+ }
85
+
86
+ /**
87
+ * Apports totaux à travers l'espace tampon
88
+ * @type {number}
89
+ */
90
+ const Sstj = baies.reduce((acc, bv) => {
91
+ return acc + this.ssdBaieMois(bv, ctx.zoneClimatique.id, mois, 0.8 * T + 0.024);
92
+ }, 0);
93
+
94
+ /**
95
+ * Surface sud équivalente représentant l’impact des apports solaires indirects associés au rayonnement
96
+ * solaire entrant dans la partie habitable du logement après de multiples réflexions dans l’espace tampon solarisé
97
+ * @type {number}
98
+ */
99
+ const Ssindj = Sstj - Ssdj;
100
+
101
+ /**
102
+ * Impact de l’espace tampon solarisé sur les apports solaires à travers les baies vitrées qui séparent le logement
103
+ * de l'espace tampon
104
+ * @type {number}
105
+ */
106
+ SseVerandaj = Ssdj + Ssindj * bver;
107
+ }
108
+ }
109
+
110
+ return baiesVitrees.reduce((acc, baieVitree) => {
111
+ const typeAdjacence = parseInt(baieVitree.donnee_entree.enum_type_adjacence_id);
112
+
113
+ /**
114
+ * 6.3 Traitement des espaces tampons solarisés
115
+ * 10 - 'espace tampon solarisé (véranda,loggia fermée)'
116
+ */
117
+ if (typeAdjacence === 10 && ets) {
118
+ return acc + SseVerandaj;
119
+ }
120
+
121
+ // Pour les fenêtres qui ne donnent pas sur l'extérieur, pas de surface sud équivalente
122
+ if (typeAdjacence !== 1) {
123
+ return acc;
124
+ }
125
+
126
+ return acc + this.ssdBaieMois(baieVitree, ctx.zoneClimatique.id, mois);
127
+ }, 0);
128
+ }
129
+
130
+ /**
131
+ * Retourne la liste des baies vitrées qui donnent sur l'espace tampon solarisé
132
+ * @param baiesVitrees {BaieVitree[]}
133
+ */
134
+ getBaiesSurEspaceTampon(baiesVitrees) {
135
+ return baiesVitrees.filter((bv) => parseInt(bv.donnee_entree.enum_type_adjacence_id) === 10);
136
+ }
137
+
138
+ /**
139
+ * Calcul de la surface sud équivalente pour une baie vitrée bv et pendant un mois donné
140
+ *
141
+ * @param baieVitree {BaieVitree|BaieEts}
142
+ * @param zc {string} zone climatique du logement
143
+ * @param mois {string} mois au cours duquel calculer la surface sur équivalente de la baie vitrée
144
+ * @param coeff {number} coefficient à appliquer à cette surface sud
145
+ * @returns {number}
146
+ */
147
+ ssdBaieMois(baieVitree, zc, mois, coeff) {
148
+ const baieVitreeDE = baieVitree.donnee_entree;
149
+ const baieVitreeDI = baieVitree.donnee_intermediaire || {};
150
+
151
+ const C1 = this.#tvStore.getCoefficientBaieVitree(
152
+ parseInt(baieVitreeDE.enum_orientation_id),
153
+ parseInt(baieVitreeDE.enum_inclinaison_vitrage_id ?? 3),
154
+ parseInt(zc),
155
+ mois
156
+ );
157
+
158
+ const fe1 = baieVitreeDI.fe1 ?? 1;
159
+ const fe2 = baieVitreeDI.fe2 ?? 1;
160
+
161
+ return (
162
+ baieVitreeDE.surface_totale_baie *
163
+ C1 *
164
+ (coeff || baieVitree.donnee_intermediaire.sw) *
165
+ fe1 *
166
+ fe2
167
+ );
168
+ }
169
+ }
@@ -0,0 +1,210 @@
1
+ import corpus from '../../../../../test/corpus-sano.json';
2
+ import { beforeEach, describe, expect, test, vi } from 'vitest';
3
+ import { DpeNormalizerService } from '../../../normalizer/domain/dpe-normalizer.service.js';
4
+ import { ContexteBuilder } from '../contexte.builder.js';
5
+ import { SurfaceSudEquivalenteService } from './surface-sud-equivalente.service.js';
6
+ import { getAdemeFileJson } from '../../../../../test/test-helpers.js';
7
+ import { BaieVitreeTvStore } from '../../../dpe/infrastructure/baieVitreeTv.store.js';
8
+
9
+ /** @type {SurfaceSudEquivalenteService} **/
10
+ let service;
11
+
12
+ /** @type {DpeNormalizerService} **/
13
+ let normalizerService;
14
+
15
+ /** @type {ContexteBuilder} **/
16
+ let contexteBuilder;
17
+
18
+ /** @type {BaieVitreeTvStore} **/
19
+ let tvStore;
20
+
21
+ describe('Calcul de déperdition des portes', () => {
22
+ beforeEach(() => {
23
+ tvStore = new BaieVitreeTvStore();
24
+ service = new SurfaceSudEquivalenteService(tvStore);
25
+ normalizerService = new DpeNormalizerService();
26
+ contexteBuilder = new ContexteBuilder();
27
+ });
28
+
29
+ describe('Determination de la surface sud équivalente pour une baie vitrée bv et pendant un mois donné', () => {
30
+ test.each([
31
+ {
32
+ enumOrientationId: 2,
33
+ enumInclinaisonVitrageId: 3,
34
+ fe1: 1,
35
+ fe2: 1,
36
+ sw: 0.2,
37
+ coeff: 1,
38
+ expected: 5
39
+ },
40
+ {
41
+ enumOrientationId: 2,
42
+ enumInclinaisonVitrageId: undefined,
43
+ fe1: 1,
44
+ fe2: 1,
45
+ sw: 0.2,
46
+ coeff: 1,
47
+ expected: 5
48
+ },
49
+ {
50
+ enumOrientationId: 2,
51
+ enumInclinaisonVitrageId: undefined,
52
+ fe1: 1,
53
+ fe2: 1,
54
+ sw: 0.2,
55
+ coeff: undefined,
56
+ expected: 1
57
+ },
58
+ {
59
+ enumOrientationId: 2,
60
+ enumInclinaisonVitrageId: 3,
61
+ fe1: 0.5,
62
+ fe2: 0.5,
63
+ sw: 0.2,
64
+ coeff: 1,
65
+ expected: 1.25
66
+ },
67
+ {
68
+ enumOrientationId: 2,
69
+ enumInclinaisonVitrageId: 3,
70
+ fe1: undefined,
71
+ fe2: undefined,
72
+ sw: 0.2,
73
+ coeff: 1,
74
+ expected: 5
75
+ }
76
+ ])(
77
+ 'enumOrientationId: $enumOrientationId, enumInclinaisonVitrageId: $enumInclinaisonVitrageId, fe1: $fe1,' +
78
+ 'fe2: $fe2, sw: $sw, coeff: $coeff',
79
+ ({
80
+ enumOrientationId,
81
+ enumInclinaisonVitrageId = undefined,
82
+ fe1,
83
+ fe2,
84
+ sw,
85
+ coeff = undefined,
86
+ expected
87
+ }) => {
88
+ vi.spyOn(tvStore, 'getCoefficientBaieVitree').mockReturnValue(0.5);
89
+
90
+ /** @type {BaieVitree} */
91
+ const baieVitree = {
92
+ donnee_entree: {
93
+ enum_orientation_id: enumOrientationId,
94
+ enum_inclinaison_vitrage_id: enumInclinaisonVitrageId,
95
+ surface_totale_baie: 10
96
+ },
97
+ donnee_intermediaire: { fe1, fe2, sw }
98
+ };
99
+
100
+ const ssd = service.ssdBaieMois(baieVitree, '1', 'Janvier', coeff);
101
+
102
+ if (enumInclinaisonVitrageId === undefined) {
103
+ enumInclinaisonVitrageId = 3;
104
+ }
105
+
106
+ expect(tvStore.getCoefficientBaieVitree).toHaveBeenCalledWith(
107
+ enumOrientationId,
108
+ enumInclinaisonVitrageId,
109
+ 1,
110
+ 'Janvier'
111
+ );
112
+ expect(ssd).toBe(expected);
113
+ }
114
+ );
115
+ });
116
+
117
+ describe('Determination de la surface sud équivalente des baies vitrées bv', () => {
118
+ test("Aucune pour les baies vitrées qui ne donnent pas sur l'extérieur", () => {
119
+ expect(service.execute({}, [])).toBe(0);
120
+
121
+ const baiesVitrees = [
122
+ {
123
+ donnee_entree: { enum_type_adjacence_id: 18 }
124
+ }
125
+ ];
126
+ expect(service.ssdMois({}, baiesVitrees, [], 'Janvier')).toBe(0);
127
+ });
128
+
129
+ test("Baies vitrées donnant sur l'extérieur", () => {
130
+ vi.spyOn(tvStore, 'getCoefficientBaieVitree').mockReturnValue(0.5);
131
+
132
+ /** @type {Contexte} */
133
+ const ctx = { zoneClimatique: { id: 1 } };
134
+ const baiesVitrees = [
135
+ {
136
+ donnee_entree: {
137
+ enum_type_adjacence_id: 1,
138
+ enum_orientation_id: 2,
139
+ surface_totale_baie: 10
140
+ },
141
+ donnee_intermediaire: { sw: 1 }
142
+ }
143
+ ];
144
+ expect(service.ssdMois(ctx, baiesVitrees, [], 'Janvier')).toBe(5);
145
+ expect(tvStore.getCoefficientBaieVitree).toHaveBeenCalledWith(2, 3, 1, 'Janvier');
146
+ });
147
+
148
+ test('Baies vitrées donnant sur un espace tampon solarisé', () => {
149
+ vi.spyOn(tvStore, 'getCoefficientBaieVitree').mockReturnValue(0.5);
150
+
151
+ /** @type {Contexte} */
152
+ const ctx = { zoneClimatique: { id: 1 } };
153
+ const baiesVitrees = [
154
+ {
155
+ donnee_entree: {
156
+ enum_type_adjacence_id: 10,
157
+ enum_orientation_id: 2,
158
+ surface_totale_baie: 10
159
+ },
160
+ donnee_intermediaire: { sw: 1 }
161
+ },
162
+ {
163
+ donnee_entree: {
164
+ enum_type_adjacence_id: 1,
165
+ enum_orientation_id: 2,
166
+ surface_totale_baie: 10
167
+ },
168
+ donnee_intermediaire: { sw: 1 }
169
+ }
170
+ ];
171
+ const ets = {
172
+ donnee_intermediaire: { bver: 0.6, coef_transparence_ets: 0.4 },
173
+ baie_ets_collection: {
174
+ baie_ets: {
175
+ donnee_entree: {
176
+ enum_inclinaison_vitrage_id: 3,
177
+ enum_orientation_id: 1,
178
+ surface_totale_baie: 7
179
+ }
180
+ }
181
+ }
182
+ };
183
+ expect(service.ssdMois(ctx, baiesVitrees, ets, 'Janvier')).toBe(6.5224);
184
+ expect(tvStore.getCoefficientBaieVitree).toHaveBeenCalledWith(2, 3, 1, 'Janvier');
185
+ expect(tvStore.getCoefficientBaieVitree).toHaveBeenCalledWith(1, 3, 1, 'Janvier');
186
+ });
187
+ });
188
+
189
+ describe("Test d'intégration pour surface sud équivalente", () => {
190
+ test.each(corpus)(
191
+ 'vérification des DI de la surface sud équivalente pour dpe %s',
192
+ (ademeId) => {
193
+ /**
194
+ * @type {Dpe}
195
+ */
196
+ let dpeRequest = getAdemeFileJson(ademeId);
197
+ dpeRequest = normalizerService.normalize(dpeRequest);
198
+
199
+ /** @type {Contexte} */
200
+ const ctx = contexteBuilder.fromDpe(dpeRequest);
201
+
202
+ const sse = service.execute(ctx, dpeRequest.logement.enveloppe);
203
+ expect(sse).toBeCloseTo(
204
+ dpeRequest.logement.sortie.apport_et_besoin.surface_sud_equivalente,
205
+ 2
206
+ );
207
+ }
208
+ );
209
+ });
210
+ });
@@ -1,10 +1,15 @@
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
- enumPeriodeConstructionId: string;
6
- surfaceHabitable: string;
7
- hauteurSousPlafond: string;
8
- zoneClimatiqueId: string;
5
+ typeDpe: TypeDpe;
6
+ enumPeriodeConstructionId: number;
7
+ surfaceHabitable: number;
8
+ hauteurSousPlafond: number;
9
+ nombreAppartement: number;
10
+ zoneClimatique: {
11
+ id: string;
12
+ value: string;
13
+ };
9
14
  effetJoule: boolean;
10
15
  }
@@ -4,5 +4,5 @@ export interface DeperditionData {
4
4
  surfaceAue?: number;
5
5
  enumCfgIsolationLncId?: string;
6
6
  tvCoefReductionDeperditionId?: string;
7
- zoneClimatiqueId?: string;
7
+ zoneClimatique?: string;
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open3cl/engine",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Open Source 3CL-DPE engine",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -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
- }