diff --git a/src/components/Options/ProfileTypeOptions.spec.tsx b/src/components/Options/ProfileTypeOptions.spec.tsx index 115ca13d1aeef5d68717ff873580815194ad93be..dd73ade1b24dc97b43f074ec6d5ce4b35e25e759 100644 --- a/src/components/Options/ProfileTypeOptions.spec.tsx +++ b/src/components/Options/ProfileTypeOptions.spec.tsx @@ -10,6 +10,7 @@ import profileIcon from 'assets/icons/ico/profile.svg' import { HousingType, IndividualInsulationWork, + IndividualOrCollective, ThreeChoicesAnswer, } from 'enum/profileType.enum' @@ -87,6 +88,7 @@ describe('ProfileTypeOptions component', () => { const profileTypeCompleted = { ...profileData, } + profileTypeCompleted.profileType.heating = IndividualOrCollective.INDIVIDUAL profileTypeCompleted.isProfileTypeCompleted = true profileTypeCompleted.profileType.housingType = HousingType.APPARTMENT profileTypeCompleted.profileType.hasInstalledVentilation = diff --git a/src/components/Options/ProfileTypeOptions.tsx b/src/components/Options/ProfileTypeOptions.tsx index 93494d40dd6c38e805b8e4a6bc92f10c26255310..78a6fd15cb36a38137e2cdcfcb3a63f5b1687120 100644 --- a/src/components/Options/ProfileTypeOptions.tsx +++ b/src/components/Options/ProfileTypeOptions.tsx @@ -9,7 +9,6 @@ import { HousingType, ThreeChoicesAnswer, OutsideFacingWalls, - ConstructionYear, } from 'enum/profileType.enum' import { FluidType } from 'enum/fluid.enum' import { useHistory } from 'react-router-dom' @@ -82,8 +81,7 @@ const ProfileTypeOptions: React.FC = () => { `profile_type.housing_type.${profile.profileType.housingType}` )} </div> - {profile.profileType.constructionYear !== - ConstructionYear.UNKNOWN && ( + {profile.profileType.constructionYear && ( <div className="value"> {t( `profile_type.construction_year.${'text_' + diff --git a/src/constants/consumptionConstants/electricSpecific.json b/src/constants/consumptionConstants/electricSpecific.json index 86968545b046c8466cde29e61440f29b08f56234..17bef6c57f9a2fac40bf69d45a8cb824545f16a5 100644 --- a/src/constants/consumptionConstants/electricSpecific.json +++ b/src/constants/consumptionConstants/electricSpecific.json @@ -13,6 +13,6 @@ "between_1975_and_1989": 1780, "between_1990_and_1998": 1670, "after_1999": 2060, - "unknown": 1780 + "unknown": 2060 } } diff --git a/src/constants/consumptionConstants/heating.json b/src/constants/consumptionConstants/heating.json index a4c49b014fb37664d9edf0675f4d68e70e9aa15d..88435daa11683dd96a5c593087113afdc5ae4c40 100644 --- a/src/constants/consumptionConstants/heating.json +++ b/src/constants/consumptionConstants/heating.json @@ -6,7 +6,7 @@ "between_1975_and_1989": 140, "between_1990_and_1998": 129, "after_1999": 106, - "unknown": 140 + "unknown": 106 }, "appartment": { "before_1948": 119, @@ -14,7 +14,7 @@ "between_1975_and_1989": 105, "between_1990_and_1998": 73, "after_1999": 74, - "unknown": 105 + "unknown": 74 } }, "adjustment_outisde_facing_walls": { @@ -93,12 +93,12 @@ "unknown": { "none": 0, "roof_insulation": 0, - "window_replacement": -0.06, - "wall_insulation": -0.2, - "window_replacement_and_wall_insulation": -0.25, - "window_replacement_and_roof_insulation": -0.07, - "roof_and_wall_insulation": -0.2, - "window_replacement_and_roof_and_wall_insulation": -0.25 + "window_replacement": 0, + "wall_insulation": 0, + "window_replacement_and_wall_insulation": 0, + "window_replacement_and_roof_insulation": 0, + "roof_and_wall_insulation": 0, + "window_replacement_and_roof_and_wall_insulation": 0 } }, "adjustment_facilities": { diff --git a/src/locales/fr.json b/src/locales/fr.json index 9a0b1fa5281e7c47c90c47dc8d776cbffc2400ca..5f513236671c32d67d2e0b1e058c0a1d752993c4 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -451,6 +451,7 @@ "text_between_1975_and_1989": "Construit entre 1975 et 1989", "text_between_1990_and_1998": "Construit entre 1990 et 1998", "text_after_1999": "Construit après 1999", + "text_unknown": "Construit après 1999", "before_1948": "Avant 1948", "between_1948_and_1974": "Entre 1975 et 1989", "between_1975_and_1989": "Entre 1975 et 1989", diff --git a/src/store/profile/profile.reducer.ts b/src/store/profile/profile.reducer.ts index 7845ce026fa52888769f652946c2e9f1a864d499..3f4c39056e6710b16b5502c32ec3cdef5253bc49 100644 --- a/src/store/profile/profile.reducer.ts +++ b/src/store/profile/profile.reducer.ts @@ -10,7 +10,6 @@ import { Floor, HotWaterEquipment, HousingType, - IndividualInsulationWork, IndividualOrCollective, OutsideFacingWalls, ThreeChoicesAnswer, @@ -32,25 +31,22 @@ const initialState: Profile = { monthlyAnalysisDate: DateTime.fromISO('0000-01-01T00:00:00.000Z'), isProfileTypeCompleted: false, profileType: { - housingType: HousingType.INDIVIDUAL_HOUSE, - constructionYear: ConstructionYear.BETWEEN_1975_AND_1989, - area: 100, - occupantsNumber: 4, - outsideFacingWalls: OutsideFacingWalls.TWO, - floor: Floor.NOT_APPLICABLE, - heating: IndividualOrCollective.INDIVIDUAL, + housingType: HousingType.APPARTMENT, + constructionYear: ConstructionYear.AFTER_1999, + area: 35, + occupantsNumber: 1, + outsideFacingWalls: OutsideFacingWalls.ONE, + floor: Floor.INTERMEDIATE_FLOOR, + heating: IndividualOrCollective.COLLECTIVE, coldWater: IndividualOrCollective.INDIVIDUAL, hotWater: IndividualOrCollective.INDIVIDUAL, - individualInsulationWork: [ - IndividualInsulationWork.WINDOW_REPLACEMENT, - IndividualInsulationWork.WALL_INSULATION, - ], + individualInsulationWork: [], hasInstalledVentilation: ThreeChoicesAnswer.NO, hasReplacedHeater: ThreeChoicesAnswer.NO, - hotWaterEquipment: HotWaterEquipment.SOLAR, + hotWaterEquipment: HotWaterEquipment.OTHER, warmingFluid: FluidType.ELECTRICITY, hotWaterFluid: FluidType.ELECTRICITY, - cookingFluid: FluidType.ELECTRICITY, + cookingFluid: FluidType.GAS, }, } diff --git a/test/__mocks__/profile.mock.ts b/test/__mocks__/profile.mock.ts index 69b3b22dcb84ac304ada91fd878690ba524c62bc..055c249cf353369b9a52ad737c16d68bafb196cb 100644 --- a/test/__mocks__/profile.mock.ts +++ b/test/__mocks__/profile.mock.ts @@ -5,7 +5,6 @@ import { IndividualOrCollective, HotWaterEquipment, HousingType, - IndividualInsulationWork, OutsideFacingWalls, ThreeChoicesAnswer, } from 'enum/profileType.enum' @@ -32,24 +31,22 @@ export const profileData: Profile = { }), sendAnalysisNotification: false, profileType: { - housingType: HousingType.INDIVIDUAL_HOUSE, - constructionYear: ConstructionYear.BETWEEN_1975_AND_1989, - area: 100, - occupantsNumber: 4, - outsideFacingWalls: OutsideFacingWalls.TWO, - floor: Floor.NOT_APPLICABLE, - heating: IndividualOrCollective.INDIVIDUAL, + housingType: HousingType.APPARTMENT, + constructionYear: ConstructionYear.AFTER_1999, + area: 35, + occupantsNumber: 1, + outsideFacingWalls: OutsideFacingWalls.ONE, + floor: Floor.INTERMEDIATE_FLOOR, + heating: IndividualOrCollective.COLLECTIVE, + coldWater: IndividualOrCollective.INDIVIDUAL, hotWater: IndividualOrCollective.INDIVIDUAL, - individualInsulationWork: [ - IndividualInsulationWork.WINDOW_REPLACEMENT, - IndividualInsulationWork.WALL_INSULATION, - ], - hasReplacedHeater: ThreeChoicesAnswer.NO, + individualInsulationWork: [], hasInstalledVentilation: ThreeChoicesAnswer.NO, - hotWaterEquipment: HotWaterEquipment.SOLAR, + hasReplacedHeater: ThreeChoicesAnswer.NO, + hotWaterEquipment: HotWaterEquipment.OTHER, warmingFluid: FluidType.ELECTRICITY, hotWaterFluid: FluidType.ELECTRICITY, - cookingFluid: FluidType.ELECTRICITY, + cookingFluid: FluidType.GAS, }, isProfileTypeCompleted: false, } diff --git a/test/__mocks__/store.ts b/test/__mocks__/store.ts index 1218edad4dbf349518539ea77c669d5e2aaa4245..2edfdc8123744d8b55caf7f959ee96abeb79ca97 100644 --- a/test/__mocks__/store.ts +++ b/test/__mocks__/store.ts @@ -4,7 +4,6 @@ import { Floor, HotWaterEquipment, HousingType, - IndividualInsulationWork, IndividualOrCollective, OutsideFacingWalls, ThreeChoicesAnswer, @@ -105,25 +104,22 @@ export const mockInitialProfileState: Profile = { monthlyAnalysisDate: DateTime.fromISO('0000-01-01T00:00:00.000Z'), isProfileTypeCompleted: false, profileType: { - housingType: HousingType.INDIVIDUAL_HOUSE, - constructionYear: ConstructionYear.BETWEEN_1975_AND_1989, - area: 100, - occupantsNumber: 4, - outsideFacingWalls: OutsideFacingWalls.TWO, - floor: Floor.NOT_APPLICABLE, - heating: IndividualOrCollective.INDIVIDUAL, + housingType: HousingType.APPARTMENT, + constructionYear: ConstructionYear.AFTER_1999, + area: 35, + occupantsNumber: 1, + outsideFacingWalls: OutsideFacingWalls.ONE, + floor: Floor.INTERMEDIATE_FLOOR, + heating: IndividualOrCollective.COLLECTIVE, coldWater: IndividualOrCollective.INDIVIDUAL, hotWater: IndividualOrCollective.INDIVIDUAL, - individualInsulationWork: [ - IndividualInsulationWork.WINDOW_REPLACEMENT, - IndividualInsulationWork.WALL_INSULATION, - ], + individualInsulationWork: [], hasInstalledVentilation: ThreeChoicesAnswer.NO, hasReplacedHeater: ThreeChoicesAnswer.NO, - hotWaterEquipment: HotWaterEquipment.SOLAR, + hotWaterEquipment: HotWaterEquipment.OTHER, warmingFluid: FluidType.ELECTRICITY, hotWaterFluid: FluidType.ELECTRICITY, - cookingFluid: FluidType.ELECTRICITY, + cookingFluid: FluidType.GAS, }, }