feat(sync): add GoMag API client with Phase 0 auto-download

- New gomag_client.py service: async httpx client that downloads orders
  from GoMag API with full pagination and 1s rate-limit sleep
- config.py: add GOMAG_API_KEY, GOMAG_API_SHOP, GOMAG_ORDER_DAYS_BACK,
  GOMAG_LIMIT, GOMAG_API_URL settings
- sync_service.py: Phase 0 downloads fresh orders before reading JSONs;
  graceful skip if API keys not configured
- start.sh: auto-detect INSTANTCLIENTPATH from .env, fallback to thin mode
- .env.example: document GoMag API variables

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-03-13 23:03:39 +00:00
parent 2e65855fe2
commit b69b5e7104
5 changed files with 140 additions and 3 deletions

View File

@@ -59,6 +59,15 @@ ID_GESTIUNE=0
# Sectie implicita
ID_SECTIE=6
# =============================================================================
# GoMag API
# =============================================================================
GOMAG_API_KEY=your_api_key_here
GOMAG_API_SHOP=https://yourstore.gomag.ro
GOMAG_ORDER_DAYS_BACK=7
GOMAG_LIMIT=100
# =============================================================================
# SMTP - Notificari email (optional)
# =============================================================================