mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-12 13:28:55 +00:00
Added fireplace recommendation
This commit is contained in:
parent
4622c9229b
commit
c6506786f6
5 changed files with 12 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ const TitleMap = {
|
||||||
floor_insulation: "Floor Insulation",
|
floor_insulation: "Floor Insulation",
|
||||||
roof_insulation: "Roof Insulation",
|
roof_insulation: "Roof Insulation",
|
||||||
mechanical_ventilation: "Mechanical Ventilation",
|
mechanical_ventilation: "Mechanical Ventilation",
|
||||||
|
sealing_open_fireplace: "Sealing Open Fireplace",
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RecommendationCard({
|
export default function RecommendationCard({
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,18 @@ export default function RecommendationContainer({
|
||||||
(rec: Recommendation) => rec.default
|
(rec: Recommendation) => rec.default
|
||||||
) || { estimatedCost: 0, sapPoints: 0 };
|
) || { estimatedCost: 0, sapPoints: 0 };
|
||||||
|
|
||||||
|
const defaultFireplaceRecommendations =
|
||||||
|
categorizedRecommendations.sealing_open_fireplace?.find(
|
||||||
|
(rec: Recommendation) => rec.default
|
||||||
|
) || { estimatedCost: 0, sapPoints: 0 };
|
||||||
|
|
||||||
const [costMap, setCostMap] = useState<RecommendationMetricMap>({
|
const [costMap, setCostMap] = useState<RecommendationMetricMap>({
|
||||||
wall_insulation: defaultWallsRecommendations?.estimatedCost || 0,
|
wall_insulation: defaultWallsRecommendations?.estimatedCost || 0,
|
||||||
floor_insulation: defaultFloorRecommendations?.estimatedCost || 0,
|
floor_insulation: defaultFloorRecommendations?.estimatedCost || 0,
|
||||||
roof_insulation: defaultRoofRecommendations?.estimatedCost || 0,
|
roof_insulation: defaultRoofRecommendations?.estimatedCost || 0,
|
||||||
mechanical_ventilation:
|
mechanical_ventilation:
|
||||||
defaultVentiliationRecommendations?.estimatedCost || 0,
|
defaultVentiliationRecommendations?.estimatedCost || 0,
|
||||||
|
sealing_open_fireplace: defaultFireplaceRecommendations?.estimatedCost || 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [sapMap, setSapMap] = useState<RecommendationMetricMap>({
|
const [sapMap, setSapMap] = useState<RecommendationMetricMap>({
|
||||||
|
|
@ -66,6 +72,7 @@ export default function RecommendationContainer({
|
||||||
floor_insulation: defaultFloorRecommendations.sapPoints || 0,
|
floor_insulation: defaultFloorRecommendations.sapPoints || 0,
|
||||||
roof_insulation: defaultRoofRecommendations.sapPoints || 0,
|
roof_insulation: defaultRoofRecommendations.sapPoints || 0,
|
||||||
mechanical_ventilation: defaultVentiliationRecommendations.sapPoints || 0,
|
mechanical_ventilation: defaultVentiliationRecommendations.sapPoints || 0,
|
||||||
|
sealing_open_fireplace: defaultFireplaceRecommendations.sapPoints || 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [totalEstimatedCost, setTotalEstimatedCost] = useState(
|
const [totalEstimatedCost, setTotalEstimatedCost] = useState(
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,8 @@ export type RecommendationType =
|
||||||
| "wall_insulation"
|
| "wall_insulation"
|
||||||
| "floor_insulation"
|
| "floor_insulation"
|
||||||
| "roof_insulation"
|
| "roof_insulation"
|
||||||
| "mechanical_ventilation";
|
| "mechanical_ventilation"
|
||||||
|
| "sealing_open_fireplace";
|
||||||
|
|
||||||
export type UnnestedRecommendation = {
|
export type UnnestedRecommendation = {
|
||||||
quantity: number;
|
quantity: number;
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ export default async function RecommendationPlans({
|
||||||
const expectedEpcRating = sapToEpc(expectedSapPoints);
|
const expectedEpcRating = sapToEpc(expectedSapPoints);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mb-4">
|
<div key={index} className="mb-4">
|
||||||
<PlanCard
|
<PlanCard
|
||||||
key={index}
|
key={index}
|
||||||
expectedEpcRating={expectedEpcRating}
|
expectedEpcRating={expectedEpcRating}
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,5 @@ export interface RecommendationMetricMap {
|
||||||
floor_insulation: number;
|
floor_insulation: number;
|
||||||
roof_insulation: number;
|
roof_insulation: number;
|
||||||
mechanical_ventilation: number;
|
mechanical_ventilation: number;
|
||||||
|
sealing_open_fireplace: number;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue