Manual override system for equipment quantities, unit costs, and cost summary line items — deployed 2026-02-23
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 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 |
| 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.
| Column | Type |
|---|---|
| project_id | FK → projects |
| item_name | VARCHAR(200) |
| category | VARCHAR(100) |
| quantity_override | NUMERIC(10,2) |
| unit_cost_override | DECIMAL(12,2) |
| is_addition | BOOLEAN |
Unique on (project_id, item_name)
| Column | Type |
|---|---|
| project_id | FK → projects |
| cost_line_item_id | FK → cost_line_items |
| equipment_override | DECIMAL(12,2) |
| installation_override | DECIMAL(12,2) |
| capex_override | DECIMAL(12,2) |
| opex_override | DECIMAL(12,2) |
| bau_override | DECIMAL(12,2) |
| 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 |