uselotus/lotus

Move Cost Analysis into Custom Viewset

diego-escobedo opened this issue · 1 comments

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:

  1. transfer logic to the customer viewset
  2. regenerate schemas
  3. change the frontend urls pointing from the old endpoint to the new one

I will do it 💪