mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
setting up models for non-intrusive survey notes and added isOverride boolean to recommendations table
This commit is contained in:
parent
fb4a96dbc8
commit
329e77f274
2 changed files with 20 additions and 0 deletions
|
|
@ -204,6 +204,25 @@ export const propertyTargets = pgTable("property_targets", {
|
|||
heatDemand: text("heat_demand"),
|
||||
});
|
||||
|
||||
// This is the model for the results of non-invasive surveys, associated with a property.
|
||||
// We store the data against a uprn. Each row will contain a metadata about the survey itself
|
||||
export const NonInstrusiveSurvey = pgTable("non_intrusive_survey", {
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
uprn: bigint("uprn", { mode: "bigint" }),
|
||||
surveyDate: timestamp("survey_date"),
|
||||
surveyor: text("surveyor"),
|
||||
});
|
||||
|
||||
// This model contains the actual notes that were taken down during the non-invasive survey
|
||||
export const NonIntrusiveSurveyNotes = pgTable("non_intrusive_survey_notes", {
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
surveyId: bigint("survey_id", { mode: "bigint" })
|
||||
.notNull()
|
||||
.references(() => NonInstrusiveSurvey.id),
|
||||
title: text("title"),
|
||||
note: text("note"),
|
||||
});
|
||||
|
||||
export type Property = InferModel<typeof property, "select">;
|
||||
export type PropertyDetailsEpc = InferModel<
|
||||
typeof propertyDetailsEpc,
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ export const recommendation = pgTable("recommendation", {
|
|||
rentalYieldIncrease: real("rental_yield_increase"),
|
||||
totalWorkHours: real("total_work_hours"),
|
||||
labourDays: real("labour_days"),
|
||||
isOverride: boolean("is_override").default(false),
|
||||
});
|
||||
|
||||
export const unitQuantity: [string, ...string[]] = ["m2", "part"];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue