Skip to content

Week 5: Mindy & Michelle (Estimated Next Purchase Date)

Mindy Zwanziger edited this page Dec 10, 2019 · 4 revisions

AC:

When a purchase is recorded, a new estimated next purchase date should be calculated and recorded in the database

The following script can be used to calculate the estimated next purchase date:

https://gist.github.com/segdeha/a45ef8d6d7f094f4038a2318a9d60051

Notes:

  • From Andrew's script - ideas on what we need to do in the database when we first add an item:
    • Store date of purchase
    • Store number of purchases for the item
    • Store next purchase date

I think the app will need to update our numberOfDays with the result of this function.

How is a purchase recorded?


  • Changes to database:
    • change all three of above
    • change numberOfDays
Clone this wiki locally