Add pending actions for new inventories
When a new Inventory
is added to GG-CE, the system must automatically register two PENDING InventoryAction
records:
-
QUANTITYSET
: Quantity update -- The actual amount of material is inspected. -
LOCATIONSET
: Location update -- The location of the inventory is set.
These two actions are automatically closed when:
-
QUANTITYSET
is closed whenInventory#quantity
is updated -
LOCATIONSET
is closed whenInventory#storageLocation1..4
is updated
The codes need to be registered as CommunityCodeValues
.
It may be sensible to add an aspect on the #save
method(s) of InventoryRepository
, check if Inventory
is not yet persisted and add these actions in the aspect.
Also the InventoryService#addInventoryAction
should first try to close an existing pending action before adding a new one. It should be renamed to #closeInventoryAction
.