feat(providers): add balldontlie http adapter with backend selection

This commit is contained in:
Alfredo Di Stasio
2026-03-10 12:11:03 +01:00
parent f9329df64f
commit acfccbea08
12 changed files with 917 additions and 16 deletions

View File

@ -155,8 +155,8 @@ Default auth routes:
- Open `/admin/` -> `IngestionRun`
- Use admin actions:
- `Queue full MVP sync`
- `Queue incremental MVP sync`
- `Queue full sync (default provider)`
- `Queue incremental sync (default provider)`
- `Retry selected ingestion runs`
### Trigger from shell (manual)
@ -167,7 +167,7 @@ docker compose exec web python manage.py shell
```python
from apps.ingestion.tasks import trigger_full_sync
trigger_full_sync.delay(provider_namespace="mvp_demo")
trigger_full_sync.delay(provider_namespace="balldontlie")
```
### Logs and diagnostics
@ -176,6 +176,16 @@ trigger_full_sync.delay(provider_namespace="mvp_demo")
- Structured error records: `IngestionError`
- Provider entity mappings + diagnostic payload snippets: `ExternalMapping`
## Provider Backend Selection
Provider backend is selected via environment variables:
- `PROVIDER_BACKEND=demo` uses the local JSON fixture adapter (`mvp_demo`)
- `PROVIDER_BACKEND=balldontlie` uses the HTTP adapter (`balldontlie`)
- `PROVIDER_DEFAULT_NAMESPACE` can override backend mapping explicitly
The balldontlie adapter is NBA-centric and intended as MVP ingestion only. The provider abstraction remains ready for future multi-league providers (for example Sportradar or FIBA GDAP).
## GitFlow Workflow
GitFlow is required in this repository: