department-of-veterans-affairs / notification-api

Notification API
MIT License
16 stars 9 forks source link

SPIKE: TODO Use "/v2/" route in Template class once available #884

Open trevor2718 opened 2 years ago

trevor2718 commented 2 years ago

User Story - Business Goal

The code is littered with TODO comments that are not linked to tickets and not well understood. This TODO concerns using the /v2/templates route in the Template class of notification-api/app/models.py "when available". The /v2/templates route has been available for some time.

The goal of this ticket is to determine if we should deprecate the existing templates route, {{notification-api-url}}/service/{{service-id}}/template for the new template route{{notification-api-url}}/v2/templates

User Story(ies)

As a VANotify I want to clean up TODO comments So that the code is more readily maintained

As a VANotify I want to determine the utility of the v2 template route So that we can provide a better service to our clients

Additional Info and Resources

TODO: Use "/v2/" route in Template class once available.

  def get_link(self):
      # TODO: use "/v2/" route once available
      return url_for(
          "template.get_template_by_id_and_service_id",
          service_id=self.service_id,
          template_id=self.id,
          _external=True
      )

Acceptance Criteria & Checklist

Completed research addresses the problems and/or answers the questions below:

  1. It is unclear why a v2 route even exists for templates: what was it trying to solve?
  2. Should we sunset the existing template route (noting that Strike directly accesses the DB for template crud, without using our endpoints) and perform the work asked in the TODO?
  3. Should we sunset the v2 route and just remove the TODO in the code?
mjones-oddball commented 2 years ago

Hey team! Please add your planning poker estimate with Zenhub @EvanParish @k-macmillan @kalbfled @trevor2718 @jakehova @cris-oddball @ianperera

mjones-oddball commented 1 year ago

Please add your planning poker estimate with Zenhub @justaskdavidb2

mjones-oddball commented 1 year ago

@cris-oddball I left this guy in backlog because it had more content in it than usual. Not sure if that will make it easier to get to a review ready state.

mjones-oddball commented 1 year ago

Hey team! Please add your planning poker estimate with Zenhub @cris-oddball @EvanParish @kalbfled @ldraney @nikolai-efimov