Skip to content

(Week 3) Monica & Mike (add a new item to my shopping list when I purchase it for the first time)

Michael Ramirez edited this page Jan 4, 2020 · 5 revisions

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"

Sync 1: December 30

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

  1. 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?
  2. Since new to the back end will be working in Firebase
  3. 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)

Tasks due tomorrow:

6.1 FE side

  1. create a function under addItem - - under addItem (line 9) to create a function that accepts 'next purchase' and add it to the firestore

  2. under handleSubmit we need to add {next purchase} - Look at note

  3. 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

  1. Ask help how do I use Firebase?
  2. Main: to add 'next purchase' to firestore
  3. Make sure it runs with the FE

https://codesandbox.io/s/github/the-collab-lab/tcl-3-smart-shopping-list/tree/mj-mr-add-new-item-to-list


Sync 2: January 2

6.1

  • We were able to create a form for nextExpectedPurchase using Radio buttons 6.2

Sync 3: January 3

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

Difference was on the Data Structure

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 }); };