This aligns the last writing endpoints to use BaseModel (Origin, OriginVisit) objects as input.
# origin_visit_add
After adding the type effectively used, here is the comparison:
```
before def origin_visit_add(self, origin: Dict, date: Union[str, datetime.datetime], type: str) -> Optional[Dict[str, Union[str, int]]]:
after def origin_visit_add(self, origin: Origin, date: Union[str, datetime.datetime], type: str) -> Dict[str, BaseModel]:
```
The results is both 'origin' and 'visit', but only visit interests us here...
So `origin_visit_add` will be further simplified in the next diff
# origin_visit_update
After adding the type effectively used, here is the comparison
```
before def origin_visit_update(self, origin: str, visit_id: int, status: Optional[str] = None, metadata: Optional[Dict] = None, snapshot: Optional[bytes] = None):
after def origin_visit_update(self, origin: Origin, visit: OriginVisit, status: Optional[str] = None, metadata: Optional[Dict] = None, snapshot: Optional[bytes] = None) -> None:
```
Note: As origin is redundant now, `origin_visit_update` will be simplified in
one of the next diff
Impacts:
- swh-loader-core (runtime)
- swh-loader-svn (runtime)
- swh-journal (tests)
- swh-web (tests)
- swh-indexer (tests)
Depends on D2813
Note:
I planned on modifying only one endpoint but in the end, both endpoints got entangled together...
I think the current tests side-tracked me a lot.