mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
fixed generalFeatures
This commit is contained in:
parent
f70ddb0f4d
commit
3d3bc6a31a
1 changed files with 6 additions and 5 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { db } from "@/app/db/db";
|
||||
import {
|
||||
GeneralFeature,
|
||||
PropertyDetailsEpc,
|
||||
PropertyMeta,
|
||||
propertyDetailsEpc,
|
||||
|
|
@ -40,13 +41,13 @@ export async function getConditionReport(
|
|||
export function formatGeneralFeatures(
|
||||
conditionReportData: PropertyDetailsEpc,
|
||||
propertyType: string
|
||||
) {
|
||||
): GeneralFeature[] {
|
||||
// if a property is a flat/maisonette, we show heat loss coridoor information, otherwise we won't show it
|
||||
|
||||
const flatOnlyFeatures = [
|
||||
{
|
||||
feature: "Heat loss corridor",
|
||||
description: Boolean(conditionReportData.heatLossCorridor) ? "Yes" : "No",
|
||||
description: conditionReportData.heatLossCorridor ? "Yes" : "No",
|
||||
},
|
||||
{
|
||||
feature: "Heat loss corridor length",
|
||||
|
|
@ -59,7 +60,7 @@ export function formatGeneralFeatures(
|
|||
},
|
||||
];
|
||||
|
||||
const generealFeatures = [
|
||||
const generealFeatures: GeneralFeature[] = [
|
||||
{
|
||||
feature: "Floor Height",
|
||||
description: conditionReportData.floorHeight || "unknown",
|
||||
|
|
@ -78,11 +79,11 @@ export function formatGeneralFeatures(
|
|||
},
|
||||
{
|
||||
feature: "Mains gas",
|
||||
description: conditionReportData.mainsGas || "unknown",
|
||||
description: conditionReportData.mainsGas ? "Yes" : "No",
|
||||
},
|
||||
{
|
||||
feature: "Energy tariff",
|
||||
description: conditionReportData.energyTariff,
|
||||
description: conditionReportData.energyTariff || "unknown",
|
||||
},
|
||||
...(propertyType === "Flat" || propertyType === "Maisonette"
|
||||
? flatOnlyFeatures
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue