We receive product data from vendors on a regular basis to be incorporated into our catalog. The data looks like this:
[
{
id: 123,
collection: Spring,
name: New Beginnings,
size: 8,
price: 29.99,
...
},
...
{
id: 456,
collection: SUMER,
name: The Escape,
size: 6,
price: 49.99,
...
}
]
There will often be typos, so before writing to the database, we want to make the correction from "SUMER" to "Summer".
The problem with simply making the change on our end in the database is that next time we receive the list of products, the typo will be there again and it will overwrite the corrected entry.
What is an elegant and efficient way to handle this kind of problem on our end? Getting the vendors to correct the typos on their end is not feasible. Flagging the corrected row in the database to avoid writing to it is also not feasible because we may receive new/updated fields in a row (e.g. price) and we have to have the latest changes.