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

Required currency field validation not enforced #184

Open
scottohara opened this issue Mar 24, 2021 · 0 comments
Open

Required currency field validation not enforced #184

scottohara opened this issue Mar 24, 2021 · 0 comments

Comments

@scottohara
Copy link
Owner

For any required fields that have the og-currency-input directive, when the bound model value (e.g. this.transaction.amount) is undefined, the UI shows $0.00 which circumvents the required form validation for that field.

Typically this isn't a problem, because it is unusual to have, for example, a transaction with a zero amount.

The reason it came up is that for a SecurityInvestment transaction (buy/sell), where there is no commission, the UI defaults the commission field to $0.00, but when the transaction JSON is posted to the server, there is validation that checks that amount === price * quantity + commission.

This was failing because it wasn't expecting commission to be undefined.

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

No branches or pull requests

1 participant