feat(wds): limit force sync to terenuri + cladiri only

Manual trigger now only processes sync_terenuri and sync_cladiri steps.
import_nogeom and enrich are left for the regular weekend window.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
AI Assistant
2026-03-30 07:36:35 +03:00
parent 145aa11c55
commit b8061ae31f
3 changed files with 21 additions and 7 deletions
+8 -1
View File
@@ -157,11 +157,18 @@ export async function POST(request: Request) {
name?: string;
county?: string;
priority?: number;
onlySteps?: string[];
};
// Trigger is handled separately — starts sync immediately
if (body.action === "trigger") {
const result = await triggerForceSync();
const validSteps = ["sync_terenuri", "sync_cladiri", "import_nogeom", "enrich"] as const;
const onlySteps = body.onlySteps?.filter((s): s is (typeof validSteps)[number] =>
(validSteps as readonly string[]).includes(s),
);
const result = await triggerForceSync(
onlySteps && onlySteps.length > 0 ? { onlySteps } : undefined,
);
if (!result.started) {
return NextResponse.json(
{ error: result.reason },