The system I'm working on has a list of assets that belong to different customers of the company. This data is saved on an SQL database.
Removing irrelevant data, let's say the table is like this:
+----------+------------+---------------+-------------+
| asset_id | asset_name | serial_number | customer_id |
+----------+------------+---------------+-------------+
On the application, there is a data grid that displays a list of assets, with the name in the first column and other data in the other columns (serial number doesn't appear in this grid).
Please note that there isn't a specialised version of the software for each customer. This customer's data could appear at the same time as other customers' data.
One new customer has requested that, for their products only,
- Each asset's name should be a random number
- In the grid, the serial number should appear instead of the name.
The simplest (and sanest) solution would be to set the name of every asset of theirs to be the same as the serial number, especially since they apparently don't care what the name is (and no two assets will have the same serial), but they've outright refused that arrangement.
The second simplest (and much less sane, in my humble opinion) way to resolve it would be to change the SQL query that brings this data so that if the customer ID is equal to that specific customer, it would bring the serial number in the name's place, similar to the following.
select [...], case when customer_id=1234 then serial_number else asset_name end as asset_name, [...]
Of course, the engineer in me is screaming in agony.
I thought it may be better to have a "special needs" table where the customer ID is saved along with a permanent identifier (the company name could change) and the query makes sure to see if the ID is the one matching that identifier, but I'm not sure that this change would be worth it.
Can someone think of a better way to resolve this issue?