feat(parcel-sync): quality gate filter for no-geom import + diagnostic endpoint
- Filter no-geom items before import: must have identification (cadRef/CF/paperCad/paperLb) OR area - Multi-field area extraction: area, measuredArea, areaValue, suprafata - Scan quality breakdown: withCadRef, withPaperCf, withPaperCad, withArea, useful, empty - Added paperLbNo to quality analysis and samples - UI: quality breakdown grid in scan card - UI: filtered count in workflow preview (shows useful, not total) - UI: enrichment estimate uses useful count - New diagnostic endpoint /api/eterra/no-geom-debug for field inspection
This commit is contained in:
@@ -2525,12 +2525,19 @@ export function ParcelSyncModule() {
|
||||
Import parcele fără geometrie —{" "}
|
||||
<span className="font-medium text-amber-600 dark:text-amber-400">
|
||||
{(() => {
|
||||
// Only useful items will be imported (quality filter)
|
||||
const usefulNoGeom =
|
||||
noGeomScan.qualityBreakdown.useful;
|
||||
const newNoGeom = Math.max(
|
||||
0,
|
||||
noGeomScan.noGeomCount - noGeomScan.localDbNoGeom,
|
||||
usefulNoGeom - noGeomScan.localDbNoGeom,
|
||||
);
|
||||
const filtered = noGeomScan.qualityBreakdown.empty;
|
||||
return newNoGeom > 0
|
||||
? `~${newNoGeom.toLocaleString("ro-RO")} noi de importat`
|
||||
? `~${newNoGeom.toLocaleString("ro-RO")} noi de importat` +
|
||||
(filtered > 0
|
||||
? ` (${filtered.toLocaleString("ro-RO")} filtrate)`
|
||||
: "")
|
||||
: "deja importate";
|
||||
})()}
|
||||
</span>
|
||||
@@ -2540,13 +2547,13 @@ export function ParcelSyncModule() {
|
||||
Îmbogățire CF, proprietari, adrese —{" "}
|
||||
<span className="font-medium text-teal-600 dark:text-teal-400">
|
||||
{(() => {
|
||||
const usefulNoGeom = noGeomScan.qualityBreakdown.useful;
|
||||
const totalToEnrich =
|
||||
noGeomScan.localDbTotal +
|
||||
(includeNoGeom
|
||||
? Math.max(
|
||||
0,
|
||||
noGeomScan.noGeomCount -
|
||||
noGeomScan.localDbNoGeom,
|
||||
usefulNoGeom - noGeomScan.localDbNoGeom,
|
||||
)
|
||||
: 0);
|
||||
// Use enrichedComplete (not enriched) — stale
|
||||
@@ -2704,9 +2711,10 @@ export function ParcelSyncModule() {
|
||||
)}
|
||||
{includeNoGeom && (
|
||||
<p className="text-[11px] text-muted-foreground ml-7">
|
||||
Vor fi importate în DB și incluse în CSV + Magic GPKG
|
||||
(coloana HAS_GEOMETRY=0/1). În GPKG de bază apar doar
|
||||
cele cu geometrie.
|
||||
{noGeomScan.qualityBreakdown.empty > 0
|
||||
? `Din ${noGeomScan.noGeomCount.toLocaleString("ro-RO")} fără geometrie, ~${noGeomScan.qualityBreakdown.useful.toLocaleString("ro-RO")} vor fi importate (cele cu identificare sau suprafață). ${noGeomScan.qualityBreakdown.empty.toLocaleString("ro-RO")} fără nicio dată de identificare vor fi filtrate.`
|
||||
: "Vor fi importate în DB și incluse în CSV + Magic GPKG (coloana HAS_GEOMETRY=0/1)."}{" "}
|
||||
În GPKG de bază apar doar cele cu geometrie.
|
||||
</p>
|
||||
)}
|
||||
{workflowPreview}
|
||||
|
||||
Reference in New Issue
Block a user