Patch versus replacebeginner
A field that was not sent and a field sent as null are different instructions — leave it alone, versus clear it — and collapsing them is how an update to one field quietly wipes another.
Someone changed an order status and the delivery note vanished. The client only sent status. Work out the difference between "not sent" and "sent as empty".
A patch of one field changes exactly one field, and null still clears.
Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.
A field that was not sent and a field sent as null are different instructions — leave it alone, versus clear it — and collapsing them is how an update to one field quietly wipes another.
sort() and reverse() change the array you gave them, which is how a filter quietly reorders the caller's data — copy first, and the bug never exists.