Building Components

Physical structural elements of a building — walls, roofs, windows, doors, and more. Components track thermal properties (U-values), condition, area, and orientation. They serve as the foundation for Energy Calculations and link to Quotes/Invoices for financial tracking.

Source Files

LayerPath
Schemabackend/src/db/schema.ts (line ~1010)
Routesbackend/src/routes/building-components.ts, backend/src/routes/component-details.ts
U-value Routesbackend/src/routes/typology-u-values.ts
U-value Calculatorbackend/src/lib/u-value-calculator.ts
Componentsfrontend/src/components/building-components-redesign/ (18 files)
Queriesfrontend/src/lib/queries/buildingComponentQueries.ts

Database Tables

TablePurpose
building_componentsMain entity — type, area, U-value, condition, orientation, state
component_detailsSub-elements (individual windows, wall sections) with dimensions
component_quote_linksLinks components to Quotes
component_invoice_linksLinks components to Invoices

Key Fields — Components

FieldTypeNotes
buildingIduuid FKParent building (cascade)
projectIduuid FKOptional — project-scoped planned components
stateenumEntity state (current building state vs. planned)
componentTypeenumwall, roof, window, door, floor, ceiling, foundation
namevarchar(200)Display name
surfaceArearealm² — manual or calculated from details
surfaceAreaSourceenummanual or calculated
numberOfComponentsintegerCount of identical components
uValueManualrealW/(m²K) — thermal transmittance
uValueSourceenummeasurement, typology, regulatory, documented
orientationenumnorth, south, east, west, northeast, etc., horizontal
conditionenumexcellent, good, medium, fair, poor, defective, critical
isPartOfThermalHullbooleanWhether component is part of heated envelope
isCurrentBuildingStatebooleanDistinguishes actual vs. planned state
sourceComponentIduuid FKSelf-ref for tracking planned changes from originals
awardedQuoteLineItemIduuid FKLinks to awarded quote line item

Key Fields — Component Details

FieldTypeNotes
componentIduuid FKParent component (cascade)
width / heightrealMeters (windows/doors)
quantityintegerCount of identical sub-elements
uwValuerealUw value for windows W/(m²K)
surfaceAreaGross / surfaceAreaNetrealm² gross/net (walls)
insulationThicknessrealcm (walls)

Component Types

TypeTypical Properties
wallArea, orientation, U-value, insulation thickness
roofArea, U-value, construction type
windowWidth, height, Uw-value, orientation, quantity
doorWidth, height, U-value
floorArea, U-value
ceilingArea, U-value (top floor ceiling)
foundationArea, U-value (basement)

Frontend Components

ComponentPurpose
ComponentsTableRedesignDense table-based UI for all components
ComponentRow / EditableCellsInline-editable component rows
CategoryGroupGroup components by type
PlannedComponentRowsDisplay planned (future) components
UValueEditDialogEdit U-value with source selection
ComponentFieldFilesSectionAttach Files to component fields
AuditLogDialogView change history per component
ProjectComponentsTable / ProjectComponentsComparisonTableProject-scoped views with comparison
useComponentsTableActions / useComponentsTableDataState management hooks
useKeyboardNavigationKeyboard navigation for dense table
componentTableServicePure logic for table operations

U-Value Reference Data

U-values can be sourced from German building typology:

SourcePathPurpose
Typology routesbackend/src/routes/typology-u-values.tsLookup reference U-values by building type/year
Calculatorbackend/src/lib/u-value-calculator.tsCompute U-values from construction parameters

Relationships

Building Component *──1 Building
Building Component *──1 Project (optional)
Building Component *──1 Building Component (source, self-ref)
Building Component *──1 Building Component (parent, self-ref)
Building Component 1──* Component Details
Building Component *──* Quotes (via component_quote_links)
Building Component *──* Invoices (via component_invoice_links)
Building Component 1──* Scenario Measures
Building Component 1──* Funding Measures

Features

  • Dense table UI with inline editing, keyboard navigation, and category grouping
  • Current vs. planned state — track original components and project-scoped modifications
  • U-value management from multiple sources (measurement, typology, regulatory, documented)
  • Component details for sub-elements (individual windows, wall sections by floor)
  • Financial linking to Quotes and Invoices via junction tables
  • Measure linking to Measures via scenario measures
  • Energy impact — U-values and areas feed into Energy Calculations
  • Comparison views — before/after across Projects

Buildings | Measures | Quotes | Invoices | Scenarios | Energy Calculations | Scenario Planning | Financial Calculations | Files | Database Architecture