Been given an awkward design challenge, and I'm not sure how best to handle it.
The scenario is this: in the system there's a concept of "Client". Each client has various bits of supporting metadata such as contact name, business sector and so on.
The system does two things. It takes bookings against each client, and it reports on the business in those bookings.
One client, however, is different. It has a bunch of regional offices - over 100 in all, which is about five times the number of other clients in the system. For the purposes of bookings, we have to treat each office as a separate client. For the purposes of reporting, we have to treat them as a single client.
Of course, if necessary I can deal with this by putting a different if/else each and every time a client is mentioned. But that's going to be ugly as hell and hard to maintain. Some of this sort of logic is inevitable but I'd like to minimise it.
Some of it can get pushed into the Client object itself, which at least keeps it in one place. But it made me wonder: this can't be a rare scenario. Are there any pre-existing architectures or design patterns that might help?