Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18. As a user, I'd like to have the option to uncheck an item #34

Open
2 tasks
wheninseattle opened this issue Nov 16, 2022 · 0 comments
Open
2 tasks

Comments

@wheninseattle
Copy link
Collaborator

Summary

We've all accidentally deleted something before. Let's give this app a CTRL+Z! We initially discussed accomplishing this by storing all purchase dates as an array, however, Andrew made the excellent point that if you use the app for years, those array entries start to add up. If memory serves, he suggested adding two fields to the item document in firestore:

  • previousDateLastPurchased
  • previousDateNextPurchased

Acceptance criteria

  • Implement the logic to add and utilize these two fields in order to successfully uncheck an item
  • When a user unchecks an item, the values fordateNextpurchased and dateLastPurchased should return to their previous values, isChecked should be false, and the totalPurchases should be decremented by 1.

Notes

-You're brilliant!
-Think about what happens to the values of our two, new fields. What should these be set to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

1 participant