ETL Pipeline (server): - POST /api/etl/sync?mode=full|incremental — fetches ERP, aggregates, writes NocoDB - nocodbClient.ts: table discovery, paginated delete/insert - etlSync.ts: orchestrates fetch → aggregate → upsert - museumMapping.ts moved from client to server - Auth via ETL_SECRET bearer token Client: - dataService.ts reverts to reading NocoDB DailySales table - Paginated fetch via fetchNocoDBTable (handles >1000 rows) - Suspicious data check: prefers cache if NocoDB returns <10 rows - Deleted erpService.ts and client-side museumMapping.ts First full sync: 391K transactions → 5,760 daily records in 108s. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
17 lines
373 B
Plaintext
17 lines
373 B
Plaintext
# Server
|
|
SERVER_PORT=3002
|
|
|
|
# Hono ERP API (museum sales data)
|
|
ERP_API_URL=https://hono-erp.azurewebsites.net
|
|
ERP_API_CODE=your-api-function-key
|
|
ERP_USERNAME=your-username
|
|
ERP_PASSWORD=your-password
|
|
|
|
# NocoDB (for ETL writes)
|
|
NOCODB_URL=http://localhost:8090
|
|
NOCODB_TOKEN=your-token
|
|
NOCODB_BASE_ID=your-base-id
|
|
|
|
# ETL sync secret (for cron auth)
|
|
ETL_SECRET=your-secret-here
|