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

4. As a user, I want to add a new item to my shopping list #26

Open
stacietaylorcima opened this issue Jan 26, 2020 · 2 comments
Open
Assignees

Comments

@stacietaylorcima
Copy link
Contributor

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)
  • Last purchased date

AC:

  • User is presented with a form that allows them to enter the name of the item and select how soon they anticipate needing to buy it again
  • When the user submits the form, the item is saved to the database, associated with the user’s token
  • 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”
  • The last purchased date should be set to null initially
@mjhcodes
Copy link
Contributor

mjhcodes commented Feb 4, 2020

The current plan is to begin with the building of the form component, which will need:

  • useState hook to hold the item name, frequency of purchase and last purchased date
  • input fields to be used for name and date; radio buttons for the frequency (7, 14, 30) - to be styled later

The token mentioned appears to come from Issue #25 - will liaise with other pair when ready

Will need to set up function to save item object to the database.

@haleyelder
Copy link
Contributor

From our tissue (#25) and comparing your addition for Form.js, we saw the comments when adding to the firebase database that a new collection will be created on each form submit. We have the functionality ready to generate and save the token in localStorage and renders on screen. If you'd like to submit the PR and we can refactor to add the token generation, push to firebase, and pulling the data back to show in the app, that would be great!

 db.collection("userThree").add(data);
    // userThree will be replaced by user token
    // a new doc is created with each submission.

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

No branches or pull requests

4 participants