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
446 stars 467 forks source link

Add inactive storage locations and items to the seed #4526

Open cielf opened 2 months ago

cielf commented 2 months ago

Summary

Add inactive storage locations and items to the seed

Why?

Better data for when we are investigating problems and demontrating features to the stakeholders

Details

An inactive storage location may have items associated with it, but the level of those items will be zero.
An inactive item will have no current inventory.

Criteria

aman5438 commented 1 month ago

I would like to tackle this one!

cielf commented 1 month ago

It's yours!

aman5438 commented 2 weeks ago

Hello @cielf , Apologies for the delay in progress due to a medical emergency. I would appreciate it if you could clarify further on how we can create a storage location as inactive. I'm a bit confused about this. Thank you for your understanding.

cielf commented 2 weeks ago

That's a good question. I looked at the code that is called when we press the "deactivate" button on a storage location. From storage_location_deactivate_service.rb, it appears that we call discard! on the storage location to deactivate it.

So, create the storage location and then discard! it?

aman5438 commented 2 weeks ago

Thank you for the clarification. I understand now. So, after creating a storage location, I would just need to call discard! on it to set it as inactive. I’ll go ahead and implement this approach.