Currently, there is a possibility to submit and confirm the same adjustment more than once. It may happen when the user goes back to the previous screen (when the loading modal is displayed) after confirming the adjustment. It causes the stock event to be sent again.
Example reproduction steps:
Change the Network to Slow 3G and CPU to 6x slowdown;
Log into the application as administrator;
Go to Stock Management > Adjustments.
Start making adjustments for Essential Meds.
Add an adjustment and confirm it.
Refresh the page a moment after the POST stockEvents request becomes visible in "Network".
Add the same product for which the adjustment was being made to the table on the "Adjustments" screen.
The product's "Stock on Hand" is already updated, even though there was no notification.
make sure that submitting the same adjustment multiple times is impossible
the solution should not affect the performance