diamondzxd / shipnow-old

Logistics Management System
5 stars 5 forks source link

Refactor views to iron out duplicate code #23

Open diamondzxd opened 2 years ago

diamondzxd commented 2 years ago

views.py in the main app contains a lot of duplicate code which can be refactored to a function which takes in arguments from the view, call the function, and store back the results in the model.

Example : make a shipWithDelhivery() function outside the view, which will be useful for DelhiverySF (COD and PrePaid) and Delhivery5KG (COD and PrePaid) implementations.

Make the function do all the external API calls and data fetching.

Dishant10 commented 2 years ago

I'd like to work on this issue Piyush Bhaiya! It would be great if you can assign this issue to me. I'll try to raise a PR with the fix as soon as possible.

diamondzxd commented 2 years ago

Done! Happy hacking :)