alabtechnosoft You need to make the changes in the OrderController itself, but I am not sure how many changes you have made and I cannot tell you where to insert which code.
And as JusanSG pointed out, your code will only work on the backend side during the order is being created, but the Customer will still see different pricing. So there is no point in building this unless you have the react source code to edit this.
Just think, a user within 3km might see the Delivery Charge of $10 and pay the order via an online payment gateway, but when the order is placed, the order total becomes Total minus $10. So this can't be done without many changes in the frontend as well as backend.