mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
migrated database to rename adjusted energy consumption to current energy demand
This commit is contained in:
parent
fd6be9a790
commit
3c9b8b0ce5
8 changed files with 2818 additions and 8 deletions
|
|
@ -34,7 +34,7 @@ export async function GET(
|
|||
with: {
|
||||
detailsEpc: {
|
||||
columns: {
|
||||
adjustedEnergyConsumption: true,
|
||||
currentEnergyDemand: true,
|
||||
co2Emissions: true,
|
||||
estimated: true,
|
||||
},
|
||||
|
|
|
|||
1
src/app/db/migrations/0089_superb_johnny_blaze.sql
Normal file
1
src/app/db/migrations/0089_superb_johnny_blaze.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE "property_details_epc" RENAME COLUMN "adjusted_energy_consumption" TO "current_energy_demand";
|
||||
2802
src/app/db/migrations/meta/0089_snapshot.json
Normal file
2802
src/app/db/migrations/meta/0089_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -624,6 +624,13 @@
|
|||
"when": 1722373333782,
|
||||
"tag": "0088_many_tana_nile",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 89,
|
||||
"version": "5",
|
||||
"when": 1723565509020,
|
||||
"tag": "0089_superb_johnny_blaze",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ export interface PropertyMeta {
|
|||
currentSapPoints: number;
|
||||
updatedAt: string;
|
||||
detailsEpc: {
|
||||
adjustedEnergyConsumption: number | null;
|
||||
currentEnergyDemand: number | null;
|
||||
co2Emissions: number | null;
|
||||
estimated: boolean;
|
||||
};
|
||||
|
|
@ -170,7 +170,7 @@ export const propertyDetailsEpc = pgTable("property_details_epc", {
|
|||
energyTariff: text("energy_tariff"),
|
||||
primaryEnergyConsumption: real("primary_energy_consumption"),
|
||||
co2Emissions: real("co2_emissions"),
|
||||
adjustedEnergyConsumption: real("adjusted_energy_consumption"),
|
||||
currentEnergyDemand: real("current_energy_demand"),
|
||||
estimated: boolean("estimated").default(false),
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export default async function BuildingPassportHome({
|
|||
<EpcCard
|
||||
epcRating={propertyMeta.currentEpcRating}
|
||||
fullMargin={false}
|
||||
kwh={propertyMeta.detailsEpc.adjustedEnergyConsumption}
|
||||
kwh={propertyMeta.detailsEpc.currentEnergyDemand}
|
||||
carbon={propertyMeta.detailsEpc.co2Emissions}
|
||||
/>
|
||||
<div className="flex flex-col p-8 bg-white shadow rounded-md max-w-2xl mx-auto justify-start text-gray-700">
|
||||
|
|
|
|||
|
|
@ -292,8 +292,8 @@ export function formatHeatDemandFeatures(
|
|||
return [
|
||||
{
|
||||
feature: "Estimated energy consumption",
|
||||
description: conditionReportData.adjustedEnergyConsumption
|
||||
? `${conditionReportData.adjustedEnergyConsumption.toFixed(0)} kWh/year`
|
||||
description: conditionReportData.currentEnergyDemand
|
||||
? `${conditionReportData.currentEnergyDemand.toFixed(0)} kWh/year`
|
||||
: "Unknown",
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"target": "es5",
|
||||
// "target": "ESNext",
|
||||
// "target": "es5",
|
||||
"target": "ESNext",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue