feat: add parcel-sync module (eTerra ANCPI integration with PostGIS)

- 31 eTerra layer catalog (terenuri, cladiri, documentatii, administrativ)
- Incremental sync engine (OBJECTID comparison, only downloads new features)
- PostGIS-ready Prisma schema (GisFeature, GisSyncRun, GisUat models)
- 7 API routes (/api/eterra/login, count, sync, features, layers/summary, progress, sync-status)
- Full UI with 3 tabs (Sincronizare, Parcele, Istoric)
- Env var auth (ETERRA_USERNAME / ETERRA_PASSWORD)
- Real-time sync progress tracking with polling
This commit is contained in:
AI Assistant
2026-03-06 00:36:29 +02:00
parent 51dbfcb2bd
commit 7cdea66fa2
25 changed files with 3097 additions and 12 deletions
+24
View File
@@ -0,0 +1,24 @@
import { NextResponse } from "next/server";
import { getProgress } from "@/modules/parcel-sync/services/progress-store";
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
/**
* GET /api/eterra/progress?jobId=...
* Poll sync progress for a running job.
*/
export async function GET(req: Request) {
const url = new URL(req.url);
const jobId = url.searchParams.get("jobId");
if (!jobId) {
return NextResponse.json({ error: "jobId obligatoriu" }, { status: 400 });
}
const progress = getProgress(jobId);
if (!progress) {
return NextResponse.json({ jobId, status: "unknown" });
}
return NextResponse.json(progress);
}