fix(v2-import): namespace source identity for snapshot upserts

This commit is contained in:
Alfredo Di Stasio
2026-03-20 14:17:56 +01:00
parent 20d3ee7dae
commit ad85e40688
13 changed files with 272 additions and 60 deletions

View File

@ -185,6 +185,15 @@ Command behavior:
- moves valid files to archive
- moves invalid files to failed
### Source Identity Namespacing
Raw external IDs are **not globally unique** across basketball data sources. HoopScout v2 uses a namespaced identity for imported entities:
- `Competition`: unique key is `(source_name, source_uid)`
- `Team`: unique key is `(source_name, source_uid)`
- `Player`: unique key is `(source_name, source_uid)`
`source_uid` values from different sources (for example `lba` and `bcl`) can safely overlap without overwriting each other.
Import history is visible in Django admin:
- `ImportRun`
- `ImportFile`