-
Notifications
You must be signed in to change notification settings - Fork 0
(Week 3) Monica & Mike (add a new item to my shopping list when I purchase it for the first time)
6. As a user, I want to add a new item to my shopping list when I purchase it for the first time #28
A shopping list item consists of the following data points:
- Name of item
- How soon are you likely to buy it again?
- Soon (in the next 7 days)
- Kind of soon (in the next 14 days)
- Not soon (in the next 30 days)
AC:
- 6.1 User is presented with a form that allows them to enter/indicate the information listed above
- 6.2 When the user submits the form, the item is saved to the database, associated with the user’s token
- 6.3 Along with the item name, an integer corresponding to the estimated number of days until next purchase is saved: 7 for "Soon", 14 for "Kind of soon", and 30 for "Not soon"
Overview
- Meet and greet
- Establish Roles
- Review Story
- Create Plan and Small Tasks
Notes
- 6.1
- We will need to add another input below 'Add Item' Input that a uses can choose when they will next buy this item.
- FE & BE Code
- Monica will work on the FE side
- Mike will work on the BE side
- Deadline to get started and sync tomorrow 12/31 Afternoon PST
- 6.2
- We need follow up with team how we should go in accomplishing this problem
- Deadline to reach out to team is today
- 6.3
- We need follow up with team how we should go in accomplishing this problem
- Deadline to reach out to team is today
- We will be trying the PR Draft that Steve shared with Mike
Questions
- In regards to when we want to buy the item again do we have to create an alert when time has come to buy the item or is simply just listing when you want to buy the item next?
- Since new to the back end will be working in Firebase
- 6.3: Just for clarification when listing the item and integer in the view is it just the number or do we add a string (ie 7 vs 7 days till buying it again)
6.1 FE side
-
create a function under addItem - - under addItem (line 9) to create a function that accepts 'next purchase' and add it to the firestore
-
under handleSubmit we need to add {next purchase} - Look at note
-
Line 38: Is where we add the new input that takes 3 choices: How soon are you likely to buy it again?
- Soon (in the next 7 days)
- Kind of soon (in the next 14 days)
- Not soon (in the next 30 days)
6.2 BE side
- Ask help how do I use Firebase?
- Main: to add 'next purchase' to firestore
- Make sure it runs with the FE
6.1
- We were able to create a form for
nextExpectedPurchase
using Radio buttons 6.2
Monica please add notes from today
Notes
- Had a conversation with Nikema and decided to pull the latest merge and work on a new branch with the code I worked on perviously
- Luckily it was an easy refactor and everything should be working
Firebase view
Before Note: This put's the collection on the token
const addItem = () => {
const token = window.localStorage.getItem('token');
firestore.collection(token).doc(name).set(data);
}
After Note: this put's the collection on items
const addItem = name => {
firestore.collection('items').add({ name, token, nextExpectedPurchase });
};