Equipment & Cost Overrides

Manual override system for equipment quantities, unit costs, and cost summary line items — deployed 2026-02-23

Why Overrides?

Six retail/branch banking building blocks have no standard equipment mappings in the database. Craig manually adjusts these quantities in his Excel spreadsheet. The override system replicates this flexibility in the web app.

Equipment Overrides
Change auto-calculated equipment quantities and unit costs, or add entirely new equipment items not in the reference data.
Cost Overrides
Override any individual cell in the 15-row cost summary table (Equipment, Installation, CAPEX, OPEX, BAU columns).

Override Flow

1
Calculate — Auto-calculation runs the standard chain (building blocks, network design, derived items, security)
2
Review Tech Breakdown — View auto-calculated equipment with quantities and unit costs
3
Edit Equipment — Click any Qty or Unit Cost cell to edit inline. Add new items via form at bottom. Overridden cells turn orange
4
Edit Cost Summary — Click any cell in the cost summary table to override. Also highlighted orange
5
Save & Recalculate — Persists all overrides to DB, recalculates with overrides applied, refreshes view

Calculation Chain Integration

Equipment overrides slot into the existing calculation chain at step 7, after all auto-calculation but before totaling. Cost overrides apply after the 15-row summary is built.

Step Operation Type
1-2 Space aggregation + data points Auto
3-6 Tech breakdown, network design, derived items, security Auto
7 Equipment overrides applied — replace qty/cost, insert new items Override
8 Category totals (qty x regional unit prices) Auto
9 Cost summary (15-row table with formulas) Auto
10 Cost overrides applied — replace individual cells Override

API Endpoints

Method Endpoint Purpose
GET /api/projects/:id/equipment-overrides Load saved equipment overrides
PUT /api/projects/:id/equipment-overrides Save equipment overrides (delete + insert)
GET /api/projects/:id/cost-overrides Load saved cost overrides
PUT /api/projects/:id/cost-overrides Save cost overrides (delete + insert)

All PUT endpoints use a delete-then-insert pattern within a transaction.

Data Model

project_equipment_overrides
ColumnType
project_idFK → projects
item_nameVARCHAR(200)
categoryVARCHAR(100)
quantity_overrideNUMERIC(10,2)
unit_cost_overrideDECIMAL(12,2)
is_additionBOOLEAN

Unique on (project_id, item_name)

project_cost_overrides
ColumnType
project_idFK → projects
cost_line_item_idFK → cost_line_items
equipment_overrideDECIMAL(12,2)
installation_overrideDECIMAL(12,2)
capex_overrideDECIMAL(12,2)
opex_overrideDECIMAL(12,2)
bau_overrideDECIMAL(12,2)

Frontend Components

EditableTechBreakdown.tsx
Inline-editable equipment table replacing the read-only tech breakdown. Click any Qty or Unit Cost cell to edit. Orange highlighting for overrides. "Add Equipment Item" form at bottom with category dropdown. Per-row X button to revert overrides.
EditableCostSummaryTable
Inline in ProjectView.tsx. Click any cell in the 15-row cost summary to edit. Orange highlighting for overridden cells. Per-cell clear button to revert. Auto-formatted as currency on blur.
Visual indicator: All overridden values are highlighted with an orange background so users can instantly see what has been manually changed vs auto-calculated.

Key Files

File Purpose
backend/src/services/calculator.ts Override application in calculation chain (Step 7)
backend/src/routes/projects.ts 4 override CRUD endpoints
backend/src/routes/calculations.ts Loads overrides from DB, passes to calculator
frontend/src/components/EditableTechBreakdown.tsx Editable equipment table component
frontend/src/pages/ProjectView.tsx Editable cost summary + save/recalculate wiring
scripts/init-db.sql project_equipment_overrides table definition
📖  Detailed override documentation  |  Calculation engine  |  API & Data Model  |  Back to WIT PropTech