generated from the-collab-lab/smart-shopping-list-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 0
(WK 7) Amber & Monica (Compute estimated next purchase date)
MonicaDJohnson edited this page Jan 30, 2020
·
9 revisions
# Story 11: As an item, I want my estimated next purchase date to be computed at the time my purchase is recorded in the database #33
AC:
When a purchase is recorded, the estimated number of days until the next purchase date should be calculated and recorded in the database
Tasks to Complete:
- -We will need to create a component that keeps track of the number of purchases of an item.
- -We had to make two branches in order to create 2 draft PRs.
- -Must solve number of purchases first (and merge that branch) before we can work on the second branch.
- -We need to figure out how to keep track of the number of purchases of an item. There's no way to track this just by clicking the checkmark. We need to create code that collects this number and displays it as a field in Firebase.
- -Have to figure out how to update the counter in the database when you click item again in app. May be able to attach counter to checkbox. Have database check for id on button click, could possibly track number of purchases that way. (ETA: Need to track number of purchases when the checkbox is checked ONLY. Not when it is unchecked.)
Questions:
- -There is a comment in the estimate.js code that says "FIXME algorithm doesn't work when there's only 1 purchase in the database". Is that something that we need to fix, or has this already been addressed?
- -Can you only make one PR per branch? (ETA: yes)
Issues:
- Last purchase date did not populate in Firebase when we added a new item (ETA: issue fixed, I did not have the checkbox next to the item checked, so there was information that did not show in Firebase as a result).