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

Update can add negative levels of stock. Negative stock handling requires error cases. #15

Open
BarDweller opened this issue Nov 29, 2018 · 0 comments

Comments

@BarDweller
Copy link

If the PUT call is for a stock not currently held by the identified portfolio, and the stock level specified is negative. The insert will succeed and store a negative quantity of stock.

Handling for negative amounts is never really clear, it should probably result in an error, and the request being rejected entirely if a request drives a stock to negative levels, as it would imply the portfolio was not in the state the user expected. (eg, tring to remove 2000 shares from a holding of 20 should result in silently dropping the 20 shares as a 'success' it should be an error that the other 1980 requested removals were not possible, and thus the request was aborted)

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

No branches or pull requests

1 participant