diff --git a/src/app/api/eterra/export-bundle/route.ts b/src/app/api/eterra/export-bundle/route.ts index bd53658..ff4962c 100644 --- a/src/app/api/eterra/export-bundle/route.ts +++ b/src/app/api/eterra/export-bundle/route.ts @@ -272,6 +272,7 @@ export async function POST(req: Request) { phase = ph; updatePhaseProgress(done, tot); }, + // workspacePk will be auto-resolved from DB/ArcGIS inside the service }, ); diff --git a/src/app/api/eterra/no-geom-scan/route.ts b/src/app/api/eterra/no-geom-scan/route.ts index 9365c63..36b77e3 100644 --- a/src/app/api/eterra/no-geom-scan/route.ts +++ b/src/app/api/eterra/no-geom-scan/route.ts @@ -21,7 +21,10 @@ export const dynamic = "force-dynamic"; export async function POST(req: Request) { try { - const body = (await req.json()) as { siruta?: string }; + const body = (await req.json()) as { + siruta?: string; + workspacePk?: number; + }; const siruta = String(body.siruta ?? "").trim(); if (!/^\d+$/.test(siruta)) { return NextResponse.json( @@ -45,7 +48,9 @@ export async function POST(req: Request) { } const client = await EterraClient.create(username, password); - const result = await scanNoGeometryParcels(client, siruta); + const result = await scanNoGeometryParcels(client, siruta, { + workspacePk: body.workspacePk ?? null, + }); return NextResponse.json(result); } catch (error) { diff --git a/src/modules/parcel-sync/components/parcel-sync-module.tsx b/src/modules/parcel-sync/components/parcel-sync-module.tsx index fa9f504..d57bcb3 100644 --- a/src/modules/parcel-sync/components/parcel-sync-module.tsx +++ b/src/modules/parcel-sync/components/parcel-sync-module.tsx @@ -690,7 +690,10 @@ export function ParcelSyncModule() { const res = await fetch("/api/eterra/no-geom-scan", { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ siruta: s }), + body: JSON.stringify({ + siruta: s, + workspacePk: workspacePk ?? undefined, + }), }); const data = (await res.json()) as { totalImmovables?: number; @@ -699,7 +702,7 @@ export function ParcelSyncModule() { error?: string; }; if (data.error) { - // Show zero result instead of hiding the card entirely + console.warn("[no-geom-scan]", data.error); setNoGeomScan({ totalImmovables: 0, totalInDb: 0, noGeomCount: 0 }); } else { setNoGeomScan({ @@ -714,7 +717,7 @@ export function ParcelSyncModule() { } setNoGeomScanning(false); }, - [siruta], + [siruta, workspacePk], ); // Auto-scan for no-geometry parcels when UAT is selected + connected @@ -2376,7 +2379,7 @@ export function ParcelSyncModule() {
- Se verifică parcele fără geometrie în eTerra… + Se scanează lista de imobile din eTerra…
@@ -2398,19 +2401,23 @@ export function ParcelSyncModule() {

+ Din{" "} + + {noGeomScan.totalImmovables.toLocaleString("ro-RO")} + {" "} + imobile în eTerra:{" "} + + {noGeomScan.totalInDb.toLocaleString("ro-RO")} + {" "} + cu geometrie,{" "} {noGeomScan.noGeomCount.toLocaleString("ro-RO")} {" "} - parcele există în eTerra dar{" "} - nu au geometrie{" "} - în layerul GIS + fără geometrie

- Din{" "} - {noGeomScan.totalImmovables.toLocaleString("ro-RO")}{" "} - imobile total în eTerra,{" "} - {noGeomScan.totalInDb.toLocaleString("ro-RO")} sunt - deja în baza de date cu geometrie. + Cele fără geometrie există în baza de date eTerra dar + nu au contur desenat în layerul GIS.