perf(geoportal): single-parcel enrichment instead of full UAT
Previous enrichment tried to enrich ALL parcels in a UAT (minutes). Now enriches just the clicked parcel (seconds): 1. Finds the GisFeature by ID or objectId+siruta 2. Fetches immovable data from eTerra for that specific parcel 3. Persists enrichment in DB 4. Skips if enriched < 7 days ago Auto-uses env credentials (ETERRA_USERNAME/PASSWORD) — no manual login needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -65,14 +65,15 @@ export function FeatureInfoPanel({ feature, onClose }: FeatureInfoPanelProps) {
|
||||
const siruta = String(feature.properties.siruta ?? detail?.siruta ?? "");
|
||||
|
||||
const handleEnrich = async () => {
|
||||
if (!siruta) return;
|
||||
if (!detail?.id && !siruta) return;
|
||||
setEnriching(true);
|
||||
setEnrichMsg("");
|
||||
try {
|
||||
const objectId = feature.properties.object_id ?? feature.properties.objectId;
|
||||
const resp = await fetch("/api/geoportal/enrich", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ siruta }),
|
||||
body: JSON.stringify(detail?.id ? { featureId: detail.id } : { siruta, objectId: Number(objectId) }),
|
||||
});
|
||||
const d = await resp.json();
|
||||
if (resp.ok) {
|
||||
|
||||
Reference in New Issue
Block a user