Commit graph

1519 commits

Author SHA1 Message Date
Daniel Roth
de963bbc39 add file type and file source 2026-06-09 13:56:52 +00:00
Jun-te Kim
d0d5ec0366
Merge pull request #310 from Hestia-Homes/feature/frontend_landlord_overrides
Feature/frontend landlord overrides
2026-06-08 16:23:21 +01:00
Jun-te Kim
c6091af34c
Merge pull request #311 from Hestia-Homes/feature/additional_hubspot_proeprties
Feature/additional hubspot proeprties
2026-06-08 16:12:18 +01:00
Jun-te Kim
c2b7e00075 new table for new deal proeprties we want 2026-06-08 14:42:50 +00:00
Jun-te Kim
e974aef858 dynamic file tree 2026-06-08 14:08:48 +00:00
Jun-te Kim
cc134f8ce9
Merge branch 'main' into feature/frontend_landlord_overrides 2026-06-08 14:00:20 +01:00
Daniel Roth
974a5e5ef5
Merge pull request #309 from Hestia-Homes/feature/magicplan-ventilation-tables
New tables for magicplan ventilation and move opening type to window ventilation table
2026-06-08 13:23:41 +01:00
Daniel Roth
7e2be3efbd Merge branch 'main' into feature/magicplan-ventilation-tables 2026-06-08 12:21:22 +00:00
Daniel Roth
f1f48cf851
Merge pull request #308 from Hestia-Homes/feature/efficient-recommendation-backfill
Make recommendation denormalisation backfill safe and online
2026-06-08 13:20:53 +01:00
Jun-te Kim
567c3f59c5 settings .local.json updated 2026-06-08 12:01:13 +00:00
Jun-te Kim
b5d0de4069 Merge remote-tracking branch 'refs/remotes/origin/feature/frontend_landlord_overrides' into feature/frontend_landlord_overrides 2026-06-08 09:45:42 +00:00
Jun-te Kim
30d3e727d1 route of the address2uprn problem of float value 2026-06-08 09:38:48 +00:00
Jun-te Kim
f6545c2fa0 property override 2026-06-08 09:38:48 +00:00
Jun-te Kim
744bfa2287 Add v2 handover doc for property_overrides population
Self-contained brief to start a fresh context implementing the per-Property fact
layer in the bulk_upload_finaliser: locked decisions, the four-input assembly,
the two open hazards (classifier-CSV↔combiner-output join key; property_id for
no-UPRN rows), candidate architectures, and a first-steps list. v1 (async
finalise writing `property`) is shipped and working.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 09:38:48 +00:00
Jun-te Kim
b9bbd916b5 Render finalising status on the bulk-upload page and auto-advance to complete
The async finaliser (ADR-0005) introduced the `finalising` status, but the
server page's STATUS_CONFIG had no entry for it, so it fell through to the
`ready_for_processing` fallback ("Awaiting column mapping") and never mounted the
live poller — the page looked stuck even though the Lambda had inserted the
properties and written `complete`.

- Add the `finalising` card ("Uploading to ARA") to STATUS_CONFIG.
- Render OnboardingProgress during `finalising` so it polls live.
- Refresh the server page once when the poll first sees a terminal status
  (guarded by a new `serverStatus` prop to avoid a loop; uses react-query v4
  onSuccess, no useEffect) so it advances to the "Processing complete" card.
- Add a `finalising` → "Uploading to ARA" badge on the uploads list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 09:38:48 +00:00
Jun-te Kim
87aca96dfa bulk upload finaliser 2026-06-08 09:38:48 +00:00
Jun-te Kim
dff86b1ec2 save current progress 2026-06-08 09:38:48 +00:00
Jun-te Kim
22375e1746 Add Step 1 "Verify classification" to bulk-upload review (ADR-0004)
For uploads with classifier columns, surface the classifier's
description→enum assumptions on the awaiting_review screen so the user can
correct any (written source='user') and acknowledge before Finalise.
Previously only the multi-entry order step existed, so non-multi-entry
uploads got no classification review at all and the assumptions were
applied silently.

- detectMultiEntry: capture a sample whenever classifier columns are
  mapped (largest-count row if multi-entry, else first classified row);
  the sample now carries all classifier columns. "sample != null" means
  "there is something to verify"; largestCount >= 2 stays the multi-entry
  signal.
- setVerifyAck + verify-classification PATCH route + useConfirmVerification.
- VerifyClassificationPanel (Step 1); MultiEntryOrderingPanel slimmed to
  order-only with read-only classification annotation; canFinalize gated
  on both steps where each applies.
- Unit tests for detectMultiEntry + ordering helpers.

The verify_ack column + 0219 migration landed separately via #303.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 09:38:48 +00:00
Jun-te Kim
c9b7d71843 Show + edit sample classifications on awaiting_review (#298, #299)
#298: read the classifier's resolved enums for the multi-entry sample's
entries (joined from landlord_*_overrides by normalized description) and show
each beside the raw text, or "not classified" when absent.

#299: make each classification editable — a dropdown of the category's valid
enum values whose selection upserts the override by (portfolio, description)
with source='user', so the classifier never re-clobbers it. UI notes the
portfolio-wide blast radius. Verification ack is folded into the existing
order-confirm (no separate flag/migration); editing is optional review.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 09:38:48 +00:00
Jun-te Kim
65a5f57321 Confirm building-part ordering on awaiting_review (#297)
Adds the multiEntryOrdering jsonb column + interactive order picker: the
largest-count multi-entry sample is shown with a building-part dropdown per
file position (one Main building + Extensions), validated as a permutation.
A PATCH route persists { count: permutation } + confirmed, and Finalise is
disabled until the ordering is confirmed when the upload is multi-entry.

Migration for the new column is intentionally not included here — generated
after origin/main is merged (its multi_entry_summary migration lands first).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 09:38:48 +00:00
Jun-te Kim
9cb0cb19f3 lanlord exetension application 2026-06-08 09:38:21 +00:00
Jun-te Kim
2e6108a324 dev container change so its more dynamic 2026-06-08 09:37:10 +00:00
Jun-te Kim
052ab446e0 merged from main 2026-06-08 09:36:26 +00:00
Jun-te Kim
4981b0ee12 save plans for landlord overrid 2026-06-08 09:35:29 +00:00
Daniel Roth
b16e0f7d3d new tables for magicplan ventilation. move opening type from window table to window ventilation table 2026-06-08 09:25:16 +00:00
Khalim Conn-Kowlessar
6f38677da3 Make recommendation denormalisation backfill safe and online
The 0222-0225 batch backfilled plan_id/material_* onto recommendation
inside drizzle's single migration transaction. On the production table
(~26M rows) that held an AccessExclusiveLock for hours, blocked unrelated
migrations, exhausted EBS throughput credits, and could not report
progress or resume.

Split schema DDL from data backfill:
- 0222/0224: keep only instant metadata-only DDL (ADD COLUMN + FK
  NOT VALID); drop the inline CREATE INDEX.
- 0223/0225: backfills removed (now no-ops pointing to the script).
- New src/app/db/backfill-recommendation-denormalization.ts: idempotent,
  resumable, batched (committed per batch) backfill that then builds the
  indexes CONCURRENTLY and validates the FKs online.
- CONTEXT.md: document recommendation->plan (1:1) and recommendation->
  material (now at most 1; legacy multi-material rows reconciled).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 08:36:39 +00:00
Jun-te Kim
3f277f13c2 route of the address2uprn problem of float value
Some checks failed
Test Suite / unit-tests (push) Has been cancelled
2026-06-05 19:02:35 +00:00
Jun-te Kim
8618a57310 property override 2026-06-05 12:19:06 +00:00
Daniel Roth
899ac432ea
Merge pull request #307 from Hestia-Homes/feature/recommendations-migrations
Some checks failed
Test Suite / unit-tests (push) Has been cancelled
Recommendations migrations #1: add plan_id to recommendation table and backfill
2026-06-05 11:19:36 +01:00
Daniel Roth
d2c9c0696a add guard clause when backfilling plan_id to recommendation 2026-06-05 10:13:49 +00:00
Daniel Roth
694bac47e1 backfill materials columns for recommendation table 2026-06-05 10:13:31 +00:00
Daniel Roth
62b10ef808 migration for materials columns on recommendation table 2026-06-05 10:03:34 +00:00
Daniel Roth
a2a5d7212a backfill plan_id using plan_recommendations 2026-06-05 08:16:27 +00:00
Daniel Roth
c40e64bdec add plan_id column to recommendation table 2026-06-05 08:12:57 +00:00
Jun-te Kim
5716f8e5cc Add v2 handover doc for property_overrides population
Self-contained brief to start a fresh context implementing the per-Property fact
layer in the bulk_upload_finaliser: locked decisions, the four-input assembly,
the two open hazards (classifier-CSV↔combiner-output join key; property_id for
no-UPRN rows), candidate architectures, and a first-steps list. v1 (async
finalise writing `property`) is shipped and working.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 18:21:42 +00:00
Jun-te Kim
5fe86f01d8 Render finalising status on the bulk-upload page and auto-advance to complete
The async finaliser (ADR-0005) introduced the `finalising` status, but the
server page's STATUS_CONFIG had no entry for it, so it fell through to the
`ready_for_processing` fallback ("Awaiting column mapping") and never mounted the
live poller — the page looked stuck even though the Lambda had inserted the
properties and written `complete`.

- Add the `finalising` card ("Uploading to ARA") to STATUS_CONFIG.
- Render OnboardingProgress during `finalising` so it polls live.
- Refresh the server page once when the poll first sees a terminal status
  (guarded by a new `serverStatus` prop to avoid a loop; uses react-query v4
  onSuccess, no useEffect) so it advances to the "Processing complete" card.
- Add a `finalising` → "Uploading to ARA" badge on the uploads list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 18:21:35 +00:00
Jun-te Kim
fc2664aeef bulk upload finaliser 2026-06-04 11:48:02 +00:00
Jun-te Kim
71e9ba4ad3 Merge remote-tracking branch 'origin/main' into feature/frontend_landlord_overrides 2026-06-04 10:02:45 +00:00
Jun-te Kim
57d0305a1b
Merge pull request #306 from Hestia-Homes/migration/add-property-overrides
Add property_overrides table + override_component enum (0221)
2026-06-04 11:01:21 +01:00
Jun-te Kim
79c84fec53 Merge remote-tracking branch 'origin/main' into feature/frontend_landlord_overrides 2026-06-04 09:53:40 +00:00
Jun-te Kim
fa9bf538da Add property_overrides table + override_component enum (0221)
The per-Property fact layer deferred by ADR-0004: one row per
(property, building_part, override_component) holding the resolved
landlord-override enum as a denormalised text snapshot, plus the raw
spreadsheet description it resolved from.

Schema only — no writer yet. The bulk_upload_finaliser application will
populate it (recalculate-on-rerun via upsert on the unique key). Design
and rationale (snapshot-not-FK, drop source, recalculate semantics) in
docs/design/bulk-upload-finaliser.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 09:52:37 +00:00
Jun-te Kim
e923cf0ff6
Merge pull request #305 from Hestia-Homes/feature/pashub-fetcher-migration
Migration corrections
2026-06-03 14:05:22 +01:00
Daniel Roth
6d6d6a1b62 delete tempfile 2026-06-03 12:59:49 +00:00
Daniel Roth
05c31558a8 Merge branch 'main' into feature/pashub-fetcher-migration 2026-06-03 12:56:55 +00:00
Daniel Roth
2011847aa7 new migration files 2026-06-03 12:55:49 +00:00
Jun-te Kim
77cb7d9c05 save current progress 2026-06-03 11:41:48 +00:00
Daniel Roth
41c5b127c1
Merge pull request #304 from Hestia-Homes/feature/pashub-fetcher-migration
Migration for changes to EpcProperty, new property baseline table, and additional file type
2026-06-03 12:30:42 +01:00
Daniel Roth
fb952a6716 update migration sql so that new jsonb fields are mapped correctly 2026-06-03 10:49:54 +00:00
Daniel Roth
9c918c29df migration files 2026-06-03 10:43:32 +00:00
Daniel Roth
5553fee32e Add EPC round-trip fidelity fixes and property_baseline_performance table to Drizzle schema 2026-06-03 10:42:13 +00:00