I have two systems (for sake of example, and orders and an account domain). Their interfaces consist of an api per system (an orders api and an account api).
I have a UI that is sitting on top of both of these services. This ui provides search functionality, which provides visibility into both domains. The problem I'm having is, how do you handle search criteria that span both domain (for example, "Get me all of the orders with a 'Pending' status associated to an account opened more than a year ago.").
The brute force method would be to query one domain, and then filtering those results with a second query to the second domain. This gets ridiculously complicated if you add in any kind of paging; if I need 500 records that satisfy the search criteria, I need to query one api, filter those results from a second query, repeat until I have 500 records.
What would be the ddd approach to this kind of cross-domain concern?