Page MenuHomePhabricator

Move additional application logic out of SearchEntities into the use case
Open, Needs TriagePublic

Description

Validation isn't handled consistently. For most parameters, it now happens redundantly in the SearchEntities module entrypoint and then again in the use case validator. For some parameters exclusive to wbsearchentities (search profile, result language), we chose to not validate them in the use case for now. This should be consolidated somehow.

Pagination is done by SearchEntities internally, but also happens within the use case. This would automatically work in cases where we already have use cases that handle pagination (item, property), but not for the others. We'll have to make sure that it gets handled consistently for all entity types.

There are very likely other things that conceptually don't belong in SearchEntities which should also be extracted.

In this task T422136, we found that currently the use case error contain just the invalid parameter name but the value. which currently included in the wbsearchentities validation error.