mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
Adding energyAssessmentDocuments model
This commit is contained in:
parent
3c9b8b0ce5
commit
42d56835be
8 changed files with 2846 additions and 4 deletions
|
|
@ -92,7 +92,7 @@ export async function GET(
|
|||
],
|
||||
},
|
||||
{
|
||||
title: "Annual Energy consumption (kWh)/unit",
|
||||
title: "Annual energy demand (kWh)/unit",
|
||||
scenarios: [
|
||||
{
|
||||
scenarioName: scenarioName,
|
||||
|
|
|
|||
1
src/app/db/migrations/0090_youthful_silver_centurion.sql
Normal file
1
src/app/db/migrations/0090_youthful_silver_centurion.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE "property_details_epc" ADD COLUMN "current_energy_demand_heating_hotwater" real;
|
||||
2806
src/app/db/migrations/meta/0090_snapshot.json
Normal file
2806
src/app/db/migrations/meta/0090_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -631,6 +631,13 @@
|
|||
"when": 1723565509020,
|
||||
"tag": "0089_superb_johnny_blaze",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 90,
|
||||
"version": "5",
|
||||
"when": 1723570008314,
|
||||
"tag": "0090_youthful_silver_centurion",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -139,5 +139,30 @@ export const energyAssessment = pgTable("energy_assessments", {
|
|||
windows_area: real("windows_area"),
|
||||
});
|
||||
|
||||
// Against each energy assessment, there are documents that are collected on site
|
||||
// Define the table
|
||||
|
||||
export const DocumentType: [string, ...string[]] = [
|
||||
"EPR",
|
||||
"Condition Report",
|
||||
"Evidence Report",
|
||||
"Summary Information",
|
||||
"Floor Plan",
|
||||
];
|
||||
|
||||
export const DocumentTypeEnum = pgEnum("document_type", DocumentType);
|
||||
|
||||
export const energyAssessmentDocuments = pgTable(
|
||||
"energy_assessment_documents",
|
||||
{
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
energyAssessmentId: bigint("energy_assessment_id", {
|
||||
mode: "bigint",
|
||||
}).notNull(),
|
||||
documentType: DocumentTypeEnum("document_type").notNull(),
|
||||
documentLocation: text("document_location").notNull(),
|
||||
}
|
||||
);
|
||||
|
||||
// Types for the new table
|
||||
export type EnergyAssessment = InferModel<typeof energyAssessment, "select">;
|
||||
|
|
|
|||
|
|
@ -171,6 +171,9 @@ export const propertyDetailsEpc = pgTable("property_details_epc", {
|
|||
primaryEnergyConsumption: real("primary_energy_consumption"),
|
||||
co2Emissions: real("co2_emissions"),
|
||||
currentEnergyDemand: real("current_energy_demand"),
|
||||
currentEnergyDemandHeatingHotwater: real(
|
||||
"current_energy_demand_heating_hotwater"
|
||||
),
|
||||
estimated: boolean("estimated").default(false),
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ export async function getOverviewPortfolioData(
|
|||
],
|
||||
},
|
||||
{
|
||||
title: "Annual Energy consumption (kWh)/unit",
|
||||
title: "Annual energy demand (kWh)/unit",
|
||||
scenarios: [
|
||||
{
|
||||
scenarioName: "Today",
|
||||
|
|
|
|||
|
|
@ -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