fix(epay-ui): show localitate + judet on intern extracts; hide cancelled rows
The intern (and gis-api-sourced) rows showed an empty "jud." with no UAT name or county, and a few dead cancelled/test rows cluttered the list. - gis-api returns siruta + uatName but judetName is null there, and the CfExtractRow type didn't even declare those fields so adaptCfRow blanked them. Added the fields to the type; adaptCfRow now surfaces uatName + siruta. - New enrichCfLocations(rows) fills missing uatName/judetName from SIRUTA via the local GisUat table (batched, one query). Applied in both list proxies (/api/cf/orders for gis rows, /api/ancpi/orders for old legacy intern rows whose judetName was stored empty). So intern rows now read "LOCALITATE, jud. X". - Hide status='cancelled' rows from the Extrase CF list (dead — payment refused / cleaned-up bad orders, e.g. the old 354686 test). failed/review stay (actionable via Reincearca). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { prisma } from "@/core/storage/prisma";
|
||||
import { requireCfAccess } from "@/core/auth/cf-access";
|
||||
import { enrichCfLocations } from "@/modules/parcel-sync/services/cf-enrich-location";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
export const dynamic = "force-dynamic";
|
||||
@@ -57,6 +58,10 @@ export async function GET(req: Request) {
|
||||
prisma.cfExtract.count({ where }),
|
||||
]);
|
||||
|
||||
// Fill missing uatName/judetName from SIRUTA (old intern rows stored an
|
||||
// empty judetName) so the list shows localitate + judet for them too.
|
||||
await enrichCfLocations(orders);
|
||||
|
||||
// Build statusMap for multi-cadastral queries (or single if requested)
|
||||
if (cadastralNumbers.length > 0) {
|
||||
const now = new Date();
|
||||
|
||||
Reference in New Issue
Block a user