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

1 stars 0 forks source link

Issue 11 Estimate next purchase date #29

Closed NickRoccodev11 closed 1 month ago

NickRoccodev11 commented 1 month ago

Description

This ticket creates an estimate for the next purchase date of an item.

Related Issue

closes #11

Acceptance Criteria

Updates

Before

issue11before

After

issue11after

Testing Steps / QA Criteria

github-actions[bot] commented 1 month ago

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

https://tcl-74-smart-shopping-list--pr29-sd-nr-11-c1v1e3jx.web.app

(expires Fri, 20 Sep 2024 05:05:46 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 79d73546692f99aad8468c28e36db434e2c190ac

NickRoccodev11 commented 1 month ago

@shuveksha-tuladhar Thanks for the video explanation! so yes, for now that is the expected behavior. the calculateEstimate function first checks the total number of purchases an item has. if it has been purchased less than twice, the function returns daysSinceLastPurchase . (or "daysSinceLastTransaction" as it's labeled in the documentation linked above) What this means is, if you create an item and buy it on the same day, 0 days have passed since the item was last interacted with, so it sets the interval to 0. This might not be the behavior we ultimately want (considering adding an item to the list isn't technically purchasing it) but it is what we expect at this point