Move Cost Analysis into Custom Viewset
diego-escobedo opened this issue · 1 comments
diego-escobedo commented
Currently, cost_analysis is its own method in the views.py file. Since the only relevant input to cost_analysis is the customer's ID, it doesn't make sense to have it as a standalone method. Instead, we should reduce the repetitiveness of the code by adding it as a method in the customerviewset (perhaps the one in api, so we can eventually expose it to the public). This will allow us to use explicit paths /customers/{customer_id}/cost_analysis/ when referencing it and reuse the viewset's identification code.
To be considered complete, we need:
- transfer logic to the customer viewset
- regenerate schemas
- change the frontend urls pointing from the old endpoint to the new one
Aashish-Upadhyay-101 commented
I will do it 💪