Thanks for the suggestion. But wanted to ask if there is something wrong in our implementation:
1. We call get customer service's get customer method to get the customer details who has logged in.
2. If the customer is MCC, we get managed accounts under that customer using the managed customer service (by selecting predicate that none of the accounts returned can manage other accounts)
3. if the customer is not MCC, then we just return the details of that customer.
Do you think there is any caveat in this approach?
The negative conditions in step 1 are:
1. The customer returned can be null (in case user has signed up for google ad words but has not completed sign up process)
2. Multiple customer entries are returned (is this possible??)
We dont' see any negative conditions in step 2 or 3.
In the example that you have shared, the complete hierarchy is shared, an MCC can managed C1 and C2. C2 can manage C3. So we will get the complete tree. Our implementation requires that for C1 MCC account, we show C1 and C3.