---
# System prepended metadata

title: Article sports processing

---

# Article sports processing
## NewsFeed
### Article create
Imports article and tournaments and participant assigned to it, then it takes all sports from leagues and participants and assignes them to the article. 

#### Updater
Also imports all `isChecked=true` sports assigned to articles and assign article to them.

#### Importer
Sports are used as fallback option - when no sport from tournaments or participant is received, it uses sports from article.

### Article update
Nothing is happening to sports or their links to articles.

### Article delete
All links between sports and article are deleted

## NewsFeedExtended
### Relation create
We are checking if relation is sport and creating link to it. But if relation is participant or tournament we are not assigning sport from leagues or participant to th earticle. (waiting for explicit sport relation = we are assigning only direct links to received relation)

TODO: We should add participant's sports too

### Relation delete 
Only direct link between received relation and article is deleted

TODO: We should remove the participant's sport too, iff there is no other participant with that sport for the article!

TODO: If this is the last participant and the article has its own sport, it should stay there (the article's sport)

### Relation update
It is working as delete + create = delete the previous relation and creates the new one with direct links.
