From c7cf1aee49324ea6b49a815a138c3de3bb34bcb3 Mon Sep 17 00:00:00 2001 From: Claude VM Date: Wed, 20 May 2026 21:41:12 +0300 Subject: [PATCH] feat(geoportal-v2): re-enable deep-enrich for cladiri + forward layerId MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Orchestrator team shipped CLADIRI support in /api/v1/parcel/enrich (PR4): - DeepEnrichLayerId enum + optional layerId in input - inferLayerIdFromCadref() regex /-C\d+(-U\d+)?$/ — covers apartments too - loadFeature() now layer-aware (no more hardcoded layerId='TERENURI_ACTIVE') - fetchBuildingsForParcel skipped when running for a building - HTTP layer accepts layerId in body Confirmed live via gis-api container logs — manual-override calls on "304629-C2" / "304629-C3" (CLADIRI) reach orchestrator and complete. Architots side: 1. Re-enabled the "Actualizează" / "Încarcă din ANCPI" button for cladiri. The disabled+tooltip gate I added last commit was the right thing while the orchestrator path didn't accept buildings — no longer needed. 2. refreshFromAncpi now forwards feature.layerId in the request body. Skips the orchestrator's dash-suffix auto-detect — more reliable than parsing "-C3" out of cadref each time. 3. ParcelRefBody type gained optional manualOverride + layerId fields so callers can pass both through the thin client. Note from orchestrator team: extractEnrichment populates only the generic NR_CF / ADRESA / PROPRIETARI / PROPRIETARI_VECHI / SOLICITANT keys today. The CLADIRE_TYPE / CLADIRE_DESTINATIE / CLADIRE_OBSERVATII / CLADIRE_NIVELURI etc. fields the V2 building panel renders come from a different orchestrator pipeline (building-tech), already wired + populating those rows when the orchestrator's bulk-enrich runs. Single-parcel deep-enrich for a building updates NR_CF/ADRESA/ PROPRIETARI but leaves CLADIRE_* alone unless that pipeline runs in parallel — separate iteration if needed. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/lib/gis-api-client.ts | 8 ++++++++ src/modules/geoportal/v2/feature-info-panel.tsx | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lib/gis-api-client.ts b/src/lib/gis-api-client.ts index c630f6c..cf07cba 100644 --- a/src/lib/gis-api-client.ts +++ b/src/lib/gis-api-client.ts @@ -36,6 +36,14 @@ export interface ParcelRefBody { siruta: string; cadastralRef: string; force?: boolean; + /** Per-tenant override flag for /parcel/enrich quota — bumps the + * orchestrator's per-account cap from N to N×MANUAL_OVERRIDE_QUOTA_MULTIPLIER + * for a single manual user action. Ignored by every other endpoint. */ + manualOverride?: boolean; + /** Optional layer disambiguator. Required for deep-enrich on CLADIRI + * (orchestrator now accepts both TERENURI_ACTIVE and CLADIRI_ACTIVE); + * absent → orchestrator auto-detects from "-C\d+" suffix. */ + layerId?: "TERENURI_ACTIVE" | "CLADIRI_ACTIVE"; } export interface ImmAppsBody extends ParcelRefBody { diff --git a/src/modules/geoportal/v2/feature-info-panel.tsx b/src/modules/geoportal/v2/feature-info-panel.tsx index 75b68ab..cdc0a28 100644 --- a/src/modules/geoportal/v2/feature-info-panel.tsx +++ b/src/modules/geoportal/v2/feature-info-panel.tsx @@ -633,6 +633,10 @@ export function FeatureInfoPanel({ feature, onClose, onSelectFeature, basic = fa body: JSON.stringify({ siruta: feature.siruta, cadastralRef: feature.cadastralRef, + // Pass layerId so orchestrator skips its dash-suffix auto-detect + // (more reliable than parsing "-C3" out of cadref). Orchestrator + // PR ships 2026-05-20 — accepts CLADIRI_ACTIVE + TERENURI_ACTIVE. + layerId: feature.layerId, force: true, ...(opts.manual ? { manualOverride: true } : {}), }), @@ -938,8 +942,7 @@ export function FeatureInfoPanel({ feature, onClose, onSelectFeature, basic = fa