Currently, the following methods are available in the storage interface regarding origin visits retrieval:
- `origin_visit_get(self, origin: str, page_token: Optional[str] = None, order: ListOrder = ListOrder.ASC, limit: int = 10) -> PagedResult[OriginVisit]`: returns all visits of an origin in a paginated way
- `origin_visit_status_get(self, origin: str, visit: int, page_token: Optional[str] = None, order: ListOrder = ListOrder.ASC, limit: int = 10) -> PagedResult[OriginVisitStatus]`: return all statuses for a given visit in a paginated way
- `origin_visit_status_get_latest(self, origin_url: str, visit: int, allowed_statuses: Optional[List[str]] = None, require_snapshot: bool = False) -> Optional[OriginVisitStatus]`: return the latest status for a given visit
For the use case when one wants to list all visits and their latest statuses (for instance in the [visits view](https://archive.softwareheritage.org/browse/origin/visits/?origin_url=https://github.com/python/cpython) of the webapp), the following process must be applied:
1. Get all visits by calling `origin_visit_get`
2. For each visit, get its latest status by calling `origin_visit_status_get_latest`
The second step is a real bottleneck when an origin has a lot of visits as we have to send a lot of queries to the storage to get their latest statuses.
We should add a new method to the storage interface to efficiently retrieve the visits of an origin and their latest statuses.
The signature could be the following:
```
origin_visit_get_with_latest_status(self, origin: str, page_token: Optional[str] = None, order: ListOrder = ListOrder.ASC, limit: int = 10) -> PagedResult[Tuple[OriginVisit, OriginVisitStatus]]
```