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

Purchase delete: catch validation errors #4886

Open
2 tasks
cielf opened this issue Dec 22, 2024 · 2 comments · May be fixed by #4894
Open
2 tasks

Purchase delete: catch validation errors #4886

cielf opened this issue Dec 22, 2024 · 2 comments · May be fixed by #4894
Assignees

Comments

@cielf
Copy link
Collaborator

cielf commented Dec 22, 2024

Summary

Any errors on deleting a purchase are not being caught appropriately, and are leading to a 500 error instead

Why Fix

Less bank confusion, less support work (fewer 500s are almost always a Good Thing)

Details

To check out this issue
sign in as [email protected]
click on purchases, then new purchases.
Fill out the purchase, with at least one item. Make a note of the quantity (A) of that item, and save.
Click on distribution, then new Distribution
fill out the distribution. Use the same storage location you did for the purchase. For the item you noted in purchase, make sure you distribute enough so that the amount of the item left is left than the quantity (A) of that item noted from the purchase.
Now, click on purchases, then all purchases
Click on view beside the purchase you want to delete
Then click Delete. Confirm that you wish to delete.
You will get a 500 error.

Instead, you should get an error indicating that there is not enough inventory for you to delete that purchase, along with
the amount you tried to remove, and the amount available. E.g. "Could not reduce quantity by 276 - current quantity is 188 for Incontinence Pads in Main Warehouse"

Criteria for completion

  • errors are caught and displayed properly when deleting purchases
  • tests to support that behaviour
@cielf cielf added Difficulty—Beginner Help Wanted Groomed + open to all! labels Dec 22, 2024
@nozomirin
Copy link
Contributor

/assign

@cielf
Copy link
Collaborator Author

cielf commented Dec 25, 2024

Its yours

@github-actions github-actions bot removed the Help Wanted Groomed + open to all! label Dec 25, 2024
nozomirin added a commit to nozomirin/human-essentials that referenced this issue Dec 26, 2024
nozomirin added a commit to nozomirin/human-essentials that referenced this issue Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants