the-collab-lab / tcl-23-smart-shopping-list

1 stars 2 forks source link

Resolve issue where we are not recording `last_estimate` in days as specified by Issue 10 acceptance criteria #29

Closed skylerwshaw closed 3 years ago

skylerwshaw commented 3 years ago

In Issue https://github.com/the-collab-lab/tcl-23-smart-shopping-list/issues/11 we were tasked with the following Acceptance Criteria:

When a purchase is recorded, the estimated number of days until the next purchase date should be calculated and recorded in the database

The merged solution did not meet the criteria in that it stores the last_estimate value as a unix (epoch) timestamp. While the code is functional, we discussed in the Sunday sync why this value is challenging due to it not being human readable and it making debugging more difficult to reason about.

The objective to resolve this issue is to refactor the changes made in https://github.com/the-collab-lab/tcl-23-smart-shopping-list/pull/26 to store the calculated estimate in days from the last_purchased time until the anticipated time of the next purchase. We will also need to modify any consumers of the last_estimate attribute to ensure we handle the new value appropriately.

cc @yenly