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

1 stars 0 forks source link

As an item, I want my estimated next purchase date to be computed at the time my purchase is recorded in the database so the app can learn how often I buy different items. #30

Closed aidantorrence closed 3 years ago

aidantorrence commented 3 years ago

Description

We added functionality that calculates an estimate of the number of days for the next purchase using the calculateEstimate utility and records it to the firestore.

Related Issue

closes #10

Acceptance Criteria

Type of Changes

Type
:bug: Bug fix
:sparkles: New feature
:hammer: Refactoring
:100: Add tests
:link: Update dependencies
:scroll: Docs

Updates

After

image

github-actions[bot] commented 3 years ago

Visit the preview URL for this PR (updated for commit edf562c):

https://tcl-31-smart-shopping-list--pr30-at-va-10-next-purcha-dot3hvx2.web.app

(expires Fri, 12 Nov 2021 16:37:41 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

andreamartz commented 3 years ago

UPDATE: Ignore this comment. I was working off an old branch. I can delete if that is a best practice.

Thanks for working on this. I created a new list, put 'carrots' on the list, and marked it as purchased. The token for this new list was 'cat fine valve'.

Then, I looked in the database and saw this image which seems like it doesn't have all of the fields showing: carrots from list with token 'cat fine valve'

I think estimatedPurchaseDate and totalPurchases are missing. Please let me know if I'm misunderstanding the way your feature should work.

Compare to another item on another list that was already in the database that does seem to have all of the fields showing: banana from list with token 'natty puppy nolan'

UPDATE: Ignore this comment. I was working off an old branch. I can delete if that is a best practice.

gabynr commented 3 years ago

I'm not sure, but I just have asked in the slack, but I think, in calculateEstimate here estimatedPurchaseDate, you need to send the values of the attribute days that select in the radio button.