rubyforgood / human-essentials

Human Essentials is an inventory management system for diaper, incontinence, and period-supply banks. It supports them in distributing to partners, tracking inventory, and reporting stats and analytics.
https://humanessentials.app
MIT License
453 stars 486 forks source link

Don't allow deletion of items that are part of a request #4728

Open cielf opened 1 day ago

cielf commented 1 day ago

Summary

If you delete an item, any requests using that item are unviewable So you shouldn't be able to delete an item if there are any requests.

Why?

Hygiene. This is unlikely to happen in the wild.

Details

Recreation

Sign in as org_admin1, Click on Partner Agencies, then All Partners in the left hand menu Click on Pawnee Parent Service.
Click Edit Partner Information Set Group to None Update Partner Click on Inventory, then Items& Inventory in the left hand menu. Click on New Item Fill in some info, make sure Item is Visible to Partners? is checked Save Logout Sign in as verified@example.com Create a request that includes that item Save and confirm Login as org_Admin1@example.com click on requests -- you will see that request Click on Inventory | Items & Inventory click on "Delete" beside the item that you added
Confirm Click on Requests -- it was still showing the request for me, but that might be caching?
Click on View -- Get a "Still haven't found what you're looking for"

What should happen

jorgecoutinhobr commented 1 day ago

I would like to work on this issue

cielf commented 1 day ago

Please do!