Open
Conversation
…n just returning it. the two initial tests now pass
…d forgetting to put back the original class value of btn-buy...
…t and displays error messages
…e quotes collection in order_list_view.js. Identified the current market price for the symbol selected in the Order Entry Form, and adds this market price to the orderData hash to be validated in the Order model. Order model sends appropriate message to the view for target prices over or equal to the market price.
…incorrectly completes orders for sell order in Open Orders View, and incorrectly doesn't complete order when user manually changes price to meet order requirements
Ada TraderWhat We're Looking For
|
CheezItMan
reviewed
Dec 21, 2017
| errors.targetPrice = ["Cannot enter a zero value for the target price."]; | ||
| } | ||
|
|
||
| if (NaN(attributes.targetPrice)) { |
There was a problem hiding this comment.
Should be: if (isNAN(attributes.targetPrice)) {
|
|
||
| //finds the current market price and adds it to the orderData hash, to be validated in the model. | ||
| const currentQuoteModel = this.quotes.find({symbol: symbol}); | ||
| currentQuoteModel.set('buy', buyIsTrue); |
There was a problem hiding this comment.
Why add a buy attribute to Quote? Instead why not let the Order keep track of if it's buying or selling? Your solution limits you to only having buy orders or sell orders not a mix.
|
|
||
| //TODO - need to add a validation | ||
| const newOrder = new Order(orderData) | ||
| if (newOrder.isValid()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ada Trader
Congratulations! You're submitting your assignment!
Comprehension Questions