diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 35a9259..1df767f 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -19,6 +19,36 @@ model KeyValueStore { @@index([namespace]) } +// ─── GIS: Sync Scheduling ────────────────────────────────────────── + +model GisSyncRule { + id String @id @default(uuid()) + siruta String? /// Set = UAT-specific rule + county String? /// Set = county-wide default rule + frequency String /// "3x-daily"|"daily"|"weekly"|"monthly"|"manual" + syncTerenuri Boolean @default(true) + syncCladiri Boolean @default(true) + syncNoGeom Boolean @default(false) + syncEnrich Boolean @default(false) + priority Int @default(5) /// 1=highest, 10=lowest + enabled Boolean @default(true) + allowedHoursStart Int? /// null = no restriction, e.g. 1 for 01:00 + allowedHoursEnd Int? /// e.g. 5 for 05:00 + allowedDays String? /// e.g. "1,2,3,4,5" for weekdays, null = all days + lastSyncAt DateTime? + lastSyncStatus String? /// "done"|"error" + lastSyncError String? + nextDueAt DateTime? + label String? /// Human-readable note + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + @@unique([siruta, county]) + @@index([enabled, nextDueAt]) + @@index([county]) + @@index([frequency]) +} + // ─── GIS: eTerra ParcelSync ──────────────────────────────────────── model GisFeature { diff --git a/src/app/(modules)/monitor/page.tsx b/src/app/(modules)/monitor/page.tsx index 99884dc..ed7d4f1 100644 --- a/src/app/(modules)/monitor/page.tsx +++ b/src/app/(modules)/monitor/page.tsx @@ -447,7 +447,15 @@ export default function MonitorPage() { {/* Sync actions */}
+ Reguli de sincronizare eTerra — {rules.length} reguli configurate +
++ Se aplica la UAT-urile care nu au regula specifica si nici regula de judet +
+| Scope | +Frecventa | +Pasi | +Prioritate | +Ultimul sync | +Urmatorul | +Activ | +Actiuni | +
|---|
+ Scheduler-ul va procesa aceste reguli la urmatorul tick. + (Scheduler-ul unificat va fi activat in Phase 2) +
++ Seteaza frecventa de sync la nivel de judet. UAT-urile cu regula proprie o vor suprascrie. +
+| Judet | +Frecventa curenta | +Seteaza frecventa | +
|---|
{error}
} + +