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

Add a simple quantity to cart item tracking #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dnastrain
Copy link
Collaborator

Track a simple quantity, as string value, for items in the cart.

@dnastrain dnastrain requested review from gcrev93 and howlowck March 20, 2019 21:12
@dnastrain dnastrain added this to the Sprint 1: NYC Onsite Hack milestone Mar 20, 2019
Imported words-to-num package for conversions
Decided to accept 'the', 'a' and 'an' as synonymous with 'one'
Added validation for QUANTITY slot
Updated abilities to parse and save cart with updated quantities
@dnastrain
Copy link
Collaborator Author

@howlowck and @gcrev93, I pushed the update to use numbers in the simple cart for quantities

Copy link
Collaborator

@kevinleung23 kevinleung23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see inline comments for clarifications.

Nonblocking review as I am still updating myself with the codebase.

name: 'None',
traces: [
{
slotName: 'END_OF_ORDER'
slotName: 'AFFIRMATIVE'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are examples of the NLU model returning AFFIRMATIVE? Trying to understand why this is mapping to "None" ability.

Copy link
Collaborator Author

@dnastrain dnastrain Mar 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a subtle difference between Michael's NLU and Arman's -- for single-word utterances last week, such as "done", Michael's would return intent:"None", entity:"END_OF_ORDER", and Arman's returned intent:"None", entity:"AFFIRMATIVE". Your question is valid though

},
{
name: 'TARGET',
query: () => { return 'What item would you like to target?' }
query: () => { return 'What item would you like to replace?' }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was existing and for uniformity we should keep this..

but just an fyi short hand tip:
`query: () => 'What item would you like to replace?'

if (productQuantity > 0 || (existingProduct && productQuantity + existingProduct.quantity > 0)) {
retProducts = [
...remainingProducts,
{ name: productName, quantity: (existingProduct ? existingProduct.quantity + productQuantity : productQuantity) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not update the product in place. The newly "updated" product will be added onto the array at the end of the array. Just making sure this is the desired result.

@dnastrain
Copy link
Collaborator Author

dnastrain commented Apr 1, 2019 via email

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

Successfully merging this pull request may close these issues.

2 participants