feat(parcel-sync): store UATs in PostgreSQL, eliminate repeated eTerra calls

- GisUat table now includes workspacePk column (created via raw SQL)
- GET /api/eterra/uats serves from PostgreSQL  instant, no eTerra login needed
- POST /api/eterra/uats triggers sync check: compares county count with DB,
  only does full eTerra fetch if data differs or DB is empty
- Frontend loads UATs from DB on mount (fast), falls back to uat.json if empty
- On eTerra connect, fires POST to sync-check; if data changed, reloads from DB
- Workspace cache populated from DB on GET for search route performance
This commit is contained in:
AI Assistant
2026-03-06 20:56:12 +02:00
parent d948e5c1cf
commit ec5a866673
3 changed files with 165 additions and 55 deletions
+6 -4
View File
@@ -69,10 +69,12 @@ model GisSyncRun {
}
model GisUat {
siruta String @id
name String
county String?
updatedAt DateTime @updatedAt
siruta String @id
name String
county String?
workspacePk Int?
updatedAt DateTime @updatedAt
@@index([name])
@@index([county])
}