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
| Layer | Path |
|---|---|
| Schema | backend/src/db/schema.ts (buildingComponents, componentDetails) |
| Routes | backend/src/routes/building-components.ts, backend/src/routes/component-details.ts |
| U-value Routes | backend/src/routes/typology-u-values.ts |
| U-value Calculator | backend/src/lib/u-value-calculator.ts |
| Components | frontend/src/components/building-components-redesign/ (18 files) |
| Queries | frontend/src/lib/queries/buildingComponentQueries.ts |
Database Tables
| Table | Purpose |
|---|---|
building_components | Main entity — type, area, U-value, condition, orientation, state |
component_details | Sub-elements (individual windows, wall sections) with dimensions |
component_change_logs | Per-component change history (field diffs, change reason, automated flag) |
component_quote_links | Links components to Quotes |
component_invoice_links | Links components to Invoices |
Key Fields — Components
| Field | Type | Notes |
|---|---|---|
buildingId | uuid FK | Parent building (cascade) |
projectId | uuid FK | Optional — project-scoped planned components |
state | enum | as_is, planned, in_execution, executed, cancelled |
componentType | enum | wall, roof, window, door, floor, ceiling, foundation |
name | varchar(200) | Display name |
surfaceArea | real | m² — manual or calculated from details |
surfaceAreaSource | enum | manual or calculated |
numberOfComponents | integer | Count of identical components |
uValueManual | real | W/(m²K) — thermal transmittance |
uValueSource | enum | measurement, typology, regulatory, documented |
orientation | enum | north, south, east, west, northeast, etc., horizontal |
condition | enum | excellent, good, medium, fair, poor, defective, critical |
isPartOfThermalHull | boolean | Whether component is part of heated envelope |
isCurrentBuildingState | boolean | Distinguishes actual vs. planned state |
sourceComponentId | uuid FK | Self-ref for tracking planned changes from originals |
parentComponentId | uuid FK | Self-ref for component hierarchies |
replacedAtProjectId | uuid FK | Project in which the component was replaced |
constructionYear | integer | Year the component was built/installed |
structureType / constructionType | varchar | e.g., “brick wall”; specific construction type from typology |
estimatedCost | decimal(12,2) | Cost estimate (decimal string on the wire) |
fundingCategory | varchar(100) | Funding classification |
awardedQuoteLineItemId | uuid FK | Links to awarded quote line item |
Key Fields — Component Details
| Field | Type | Notes |
|---|---|---|
componentId | uuid FK | Parent component (cascade) |
width / height | real | Meters (windows/doors) |
quantity | integer | Count of identical sub-elements |
uwValue | real | Uw value for windows W/(m²K) |
surfaceAreaGross / surfaceAreaNet | real | m² gross/net (walls) |
insulationThickness | real | cm (walls) |
Component Types
| Type | Typical Properties |
|---|---|
wall | Area, orientation, U-value, insulation thickness |
roof | Area, U-value, construction type |
window | Width, height, Uw-value, orientation, quantity |
door | Width, height, U-value |
floor | Area, U-value |
ceiling | Area, U-value (top floor ceiling) |
foundation | Area, U-value (basement) |
Frontend Components
| Component | Purpose |
|---|---|
ComponentsTableRedesign | Dense table-based UI for all components |
ComponentRow / EditableCells | Inline-editable component rows |
CategoryGroup | Group components by type |
PlannedComponentRows | Display planned (future) components |
UValueEditDialog | Edit U-value with source selection |
ComponentFieldFilesSection | Attach Files to component fields |
AuditLogDialog | View change history per component |
ProjectComponentsTable / ProjectComponentsComparisonTable | Project-scoped views with comparison |
useComponentsTableActions / useComponentsTableData | State management hooks |
useKeyboardNavigation | Keyboard navigation for dense table |
componentTableService | Pure logic for table operations |
U-Value Reference Data
U-values can be sourced from German building typology:
| Source | Path | Purpose |
|---|---|---|
| Typology routes | backend/src/routes/typology-u-values.ts | Lookup reference U-values by building type/year |
| Calculator | backend/src/lib/u-value-calculator.ts | Compute 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
Related Pages
Buildings | Measures | Quotes | Invoices | Scenarios | Energy Calculations | Scenario Planning | Financial Calculations | Files | Database Architecture