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:
@@ -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])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user