-
Notifications
You must be signed in to change notification settings - Fork 43
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
Carets- Julia Meier- Ada Trader #22
base: master
Are you sure you want to change the base?
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
|
errors.targetPrice = ["Cannot enter a zero value for the target price."]; | ||
} | ||
|
||
if (NaN(attributes.targetPrice)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work with the messages!
Ada Trader
Congratulations! You're submitting your assignment!
Comprehension Questions