Creating Dynamic Item Selection and Removal

0
Hello,  I am currently working on a functionality where unique items are added, and then assigned to a shipment. These items will only be used once, so upon adding the item to a shipment, it should not be available for use again. However if an order it edited and the item removed, it should become available once again.  Once an item ships it should then finally be removed for no further use.  My question would be, what would be the best way to design the functionality for whether or not a part is available, whether via 1-1 relationships and updating the part status accordingly, as to avoid any issue of duplicate use and effective data management. 
asked
1 answers
0

You can simply add an attribute for availability of an item in the Item entity. And your Shipment entity will either have a 1-1 or 1-* relation with Item as per your requirement (Shipment could have 1 item or many items)

Now when you add items to a shipment, at that time set the available bool attribute to false. When it is removed set it to true. 

answered