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:
@@ -41,6 +41,13 @@ class Settings(BaseSettings):
|
||||
ID_GESTIUNE: int = 0
|
||||
ID_SECTIE: int = 0
|
||||
|
||||
# GoMag API
|
||||
GOMAG_API_KEY: str = ""
|
||||
GOMAG_API_SHOP: str = ""
|
||||
GOMAG_ORDER_DAYS_BACK: int = 7
|
||||
GOMAG_LIMIT: int = 100
|
||||
GOMAG_API_URL: str = "https://api.gomag.ro/api/v1/order/read/json"
|
||||
|
||||
@model_validator(mode="after")
|
||||
def resolve_paths(self):
|
||||
"""Resolve relative paths against known roots, independent of CWD."""
|
||||
|
||||
Reference in New Issue
Block a user